Class: WorklogCLI
Overview
CLI for the work log application
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#storage ⇒ Object
Returns the value of attribute storage.
Class Method Summary collapse
Instance Method Summary collapse
- #add(message) ⇒ Object
- #edit ⇒ Object
-
#initialize(args = [], options = {}, config = {}) ⇒ WorklogCLI
constructor
Initialize the CLI with the given arguments, options, and configuration.
- #people(person = nil) ⇒ Object
- #remove ⇒ Object
- #server ⇒ Object
- #show ⇒ Object
- #stats ⇒ Object
- #summary ⇒ Object
- #tags(tag = nil) ⇒ Object
- #version ⇒ Object
Methods included from StringHelper
Constructor Details
#initialize(args = [], options = {}, config = {}) ⇒ WorklogCLI
Initialize the CLI with the given arguments, options, and configuration
32 33 34 35 36 |
# File 'lib/cli.rb', line 32 def initialize(args = [], = {}, config = {}) @config = load_configuration @storage = Storage.new(@config) super end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
24 25 26 |
# File 'lib/cli.rb', line 24 def config @config end |
#storage ⇒ Object
Returns the value of attribute storage.
24 25 26 |
# File 'lib/cli.rb', line 24 def storage @storage end |
Class Method Details
.exit_on_failure? ⇒ Boolean
38 39 40 |
# File 'lib/cli.rb', line 38 def self.exit_on_failure? true end |
Instance Method Details
#add(message) ⇒ Object
56 57 58 59 |
# File 'lib/cli.rb', line 56 def add() worklog = Worklog.new worklog.add(, ) end |
#edit ⇒ Object
63 64 65 66 |
# File 'lib/cli.rb', line 63 def edit worklog = Worklog.new worklog.edit() end |
#people(person = nil) ⇒ Object
100 101 102 103 |
# File 'lib/cli.rb', line 100 def people(person = nil) worklog = Worklog.new worklog.people(person, ) end |
#remove ⇒ Object
70 71 72 73 |
# File 'lib/cli.rb', line 70 def remove worklog = Worklog.new worklog.remove() end |
#server ⇒ Object
125 126 127 128 |
# File 'lib/cli.rb', line 125 def server worklog = Worklog.new worklog.server end |
#show ⇒ Object
94 95 96 97 |
# File 'lib/cli.rb', line 94 def show worklog = Worklog.new worklog.show() end |
#stats ⇒ Object
131 132 133 134 |
# File 'lib/cli.rb', line 131 def stats worklog = Worklog.new worklog.stats() end |
#summary ⇒ Object
147 148 149 150 |
# File 'lib/cli.rb', line 147 def summary worklog = Worklog.new worklog.summary() end |
#tags(tag = nil) ⇒ Object
119 120 121 122 |
# File 'lib/cli.rb', line 119 def (tag = nil) worklog = Worklog.new worklog.(tag, ) end |
#version ⇒ Object
153 154 155 |
# File 'lib/cli.rb', line 153 def version puts "Worklog #{current_version} running on Ruby #{RUBY_VERSION}" end |