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 ⇒ Object
- #remove ⇒ Object
- #server ⇒ Object
- #show ⇒ Object
- #stats ⇒ Object
- #summary ⇒ Object
- #tags(tag = nil) ⇒ Object
- #takeout ⇒ 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 'lib/cli.rb', line 33 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
39 40 41 |
# File 'lib/cli.rb', line 39 def self.exit_on_failure? true end |
Instance Method Details
#add(message) ⇒ Object
58 59 60 61 |
# File 'lib/cli.rb', line 58 def add() worklog = Worklog::Worklog.new worklog.add(, ) end |
#edit ⇒ Object
65 66 67 68 |
# File 'lib/cli.rb', line 65 def edit worklog = Worklog::Worklog.new worklog.edit() end |
#people(person = nil) ⇒ Object
103 104 105 106 |
# File 'lib/cli.rb', line 103 def people(person = nil) worklog = Worklog::Worklog.new worklog.people(person, ) end |
#projects ⇒ Object
110 111 112 113 114 115 116 117 118 |
# File 'lib/cli.rb', line 110 def projects worklog = Worklog::Worklog.new if [:oneline] worklog.projects_oneline() else worklog.projects() end end |
#remove ⇒ Object
72 73 74 75 |
# File 'lib/cli.rb', line 72 def remove worklog = Worklog::Worklog.new worklog.remove() end |
#server ⇒ Object
149 150 151 152 |
# File 'lib/cli.rb', line 149 def server worklog = Worklog::Worklog.new worklog.server end |
#show ⇒ Object
97 98 99 100 |
# File 'lib/cli.rb', line 97 def show worklog = Worklog::Worklog.new worklog.show() end |
#stats ⇒ Object
155 156 157 158 |
# File 'lib/cli.rb', line 155 def stats worklog = Worklog::Worklog.new worklog.stats() end |
#summary ⇒ Object
171 172 173 174 |
# File 'lib/cli.rb', line 171 def summary worklog = Worklog::Worklog.new worklog.summary() end |
#tags(tag = nil) ⇒ Object
134 135 136 137 |
# File 'lib/cli.rb', line 134 def (tag = nil) worklog = Worklog::Worklog.new worklog.(tag, ) end |
#takeout ⇒ Object
143 144 145 146 |
# File 'lib/cli.rb', line 143 def takeout worklog = Worklog::Worklog.new worklog.takeout end |
#version ⇒ Object
177 178 179 |
# File 'lib/cli.rb', line 177 def version puts "Worklog #{current_version} running on Ruby #{RUBY_VERSION}" end |