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
- #projects(options = {}) ⇒ 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 = Worklog::Configuration.load @storage = Worklog::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
57 58 59 60 |
# File 'lib/cli.rb', line 57 def add() worklog = Worklog::Worklog.new worklog.add(, ) end |
#edit ⇒ Object
64 65 66 67 |
# File 'lib/cli.rb', line 64 def edit worklog = Worklog::Worklog.new worklog.edit() end |
#people(person = nil) ⇒ Object
102 103 104 105 |
# File 'lib/cli.rb', line 102 def people(person = nil) worklog = Worklog::Worklog.new worklog.people(person, ) end |
#projects(options = {}) ⇒ Object
108 109 110 111 |
# File 'lib/cli.rb', line 108 def projects( = {}) worklog = Worklog::Worklog.new worklog.projects() end |
#remove ⇒ Object
71 72 73 74 |
# File 'lib/cli.rb', line 71 def remove worklog = Worklog::Worklog.new worklog.remove() end |
#server ⇒ Object
133 134 135 136 |
# File 'lib/cli.rb', line 133 def server worklog = Worklog::Worklog.new worklog.server end |
#show ⇒ Object
96 97 98 99 |
# File 'lib/cli.rb', line 96 def show worklog = Worklog::Worklog.new worklog.show() end |
#stats ⇒ Object
139 140 141 142 |
# File 'lib/cli.rb', line 139 def stats worklog = Worklog::Worklog.new worklog.stats() end |
#summary ⇒ Object
155 156 157 158 |
# File 'lib/cli.rb', line 155 def summary worklog = Worklog::Worklog.new worklog.summary() end |
#tags(tag = nil) ⇒ Object
127 128 129 130 |
# File 'lib/cli.rb', line 127 def (tag = nil) worklog = Worklog::Worklog.new worklog.(tag, ) end |
#version ⇒ Object
161 162 163 |
# File 'lib/cli.rb', line 161 def version puts "Worklog #{current_version} running on Ruby #{RUBY_VERSION}" end |