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
-
.exit_on_failure? ⇒ Boolean
Set the exit on failure behavior from Thor to true.
Instance Method Summary collapse
- #add(message) ⇒ Object
- #edit ⇒ Object
- #github ⇒ 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
Set the exit on failure behavior from Thor to true
40 41 42 |
# File 'lib/cli.rb', line 40 def self.exit_on_failure? true end |
Instance Method Details
#add(message) ⇒ Object
62 63 64 65 |
# File 'lib/cli.rb', line 62 def add() worklog = Worklog::Worklog.new worklog.add(, ) end |
#edit ⇒ Object
69 70 71 72 |
# File 'lib/cli.rb', line 69 def edit worklog = Worklog::Worklog.new worklog.edit() end |
#github ⇒ Object
75 76 77 78 |
# File 'lib/cli.rb', line 75 def github worklog = Worklog::Worklog.new worklog.github() end |
#people(person = nil) ⇒ Object
113 114 115 116 |
# File 'lib/cli.rb', line 113 def people(person = nil) worklog = Worklog::Worklog.new worklog.people(person, ) end |
#projects ⇒ Object
120 121 122 123 124 125 126 127 128 |
# File 'lib/cli.rb', line 120 def projects worklog = Worklog::Worklog.new if [:oneline] worklog.projects_oneline() else worklog.projects() end end |
#remove ⇒ Object
82 83 84 85 |
# File 'lib/cli.rb', line 82 def remove worklog = Worklog::Worklog.new worklog.remove() end |
#server ⇒ Object
159 160 161 162 |
# File 'lib/cli.rb', line 159 def server worklog = Worklog::Worklog.new worklog.server end |
#show ⇒ Object
107 108 109 110 |
# File 'lib/cli.rb', line 107 def show worklog = Worklog::Worklog.new worklog.show() end |
#stats ⇒ Object
165 166 167 168 |
# File 'lib/cli.rb', line 165 def stats worklog = Worklog::Worklog.new worklog.stats() end |
#summary ⇒ Object
181 182 183 184 |
# File 'lib/cli.rb', line 181 def summary worklog = Worklog::Worklog.new worklog.summary() end |
#tags(tag = nil) ⇒ Object
144 145 146 147 |
# File 'lib/cli.rb', line 144 def (tag = nil) worklog = Worklog::Worklog.new worklog.(tag, ) end |
#takeout ⇒ Object
153 154 155 156 |
# File 'lib/cli.rb', line 153 def takeout worklog = Worklog::Worklog.new worklog.takeout end |
#version ⇒ Object
187 188 189 |
# File 'lib/cli.rb', line 187 def version puts "Worklog #{current_version} running on Ruby #{RUBY_VERSION}" end |