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 ⇒ Object
- #remove ⇒ Object
- #server ⇒ Object
- #show ⇒ Object
- #stats ⇒ Object
- #summary ⇒ Object
- #tags ⇒ Object
- #version ⇒ Object
Methods included from StringHelper
Constructor Details
#initialize(args = [], options = {}, config = {}) ⇒ WorklogCLI
Initialize the CLI with the given arguments, options, and configuration
33 34 35 36 37 |
# File 'worklog/cli.rb', line 33 def initialize(args = [], = {}, config = {}) @config = load_configuration @storage = Storage.new(@config) super end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
25 26 27 |
# File 'worklog/cli.rb', line 25 def config @config end |
#storage ⇒ Object
Returns the value of attribute storage.
25 26 27 |
# File 'worklog/cli.rb', line 25 def storage @storage end |
Class Method Details
.exit_on_failure? ⇒ Boolean
39 40 41 |
# File 'worklog/cli.rb', line 39 def self.exit_on_failure? true end |
Instance Method Details
#add(message) ⇒ Object
57 58 59 60 |
# File 'worklog/cli.rb', line 57 def add() worklog = Worklog.new worklog.add(, ) end |
#edit ⇒ Object
64 65 66 67 |
# File 'worklog/cli.rb', line 64 def edit worklog = Worklog.new worklog.edit() end |
#people ⇒ Object
101 102 103 104 |
# File 'worklog/cli.rb', line 101 def people worklog = Worklog.new worklog.people() end |
#remove ⇒ Object
71 72 73 74 |
# File 'worklog/cli.rb', line 71 def remove worklog = Worklog.new worklog.remove() end |
#server ⇒ Object
113 114 115 116 |
# File 'worklog/cli.rb', line 113 def server app = WorkLogApp.new(@storage) WorkLogServer.new(app).start end |
#show ⇒ Object
95 96 97 98 |
# File 'worklog/cli.rb', line 95 def show worklog = Worklog.new worklog.show() end |
#stats ⇒ Object
119 120 121 122 |
# File 'worklog/cli.rb', line 119 def stats worklog = Worklog.new worklog.stats() end |
#summary ⇒ Object
135 136 137 138 |
# File 'worklog/cli.rb', line 135 def summary worklog = Worklog.new worklog.summary() end |
#tags ⇒ Object
107 108 109 110 |
# File 'worklog/cli.rb', line 107 def worklog = Worklog.new worklog.() end |
#version ⇒ Object
141 142 143 |
# File 'worklog/cli.rb', line 141 def version puts "Worklog #{current_version} running on Ruby #{RUBY_VERSION}" end |