Class: Timekeeper::Runner
- Inherits:
-
Object
- Object
- Timekeeper::Runner
- Defined in:
- lib/timekeeper/runner.rb
Class Method Summary collapse
Class Method Details
.tk(args) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/timekeeper/runner.rb', line 5 def self.tk(args) = KeeperOptions.new(args) if .any? tk = Keeper.new tk.config(.delete(:config)) if [:config] if id = [:remove] tk.delete(id) elsif id = .delete(:update) tk.update(id, ) elsif id = .delete(:track) tk.track(id, [:name]) if [:name] else tk.store() end tk.close else puts .opts end end |
.tv(args) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/timekeeper/runner.rb', line 26 def self.tv(args) = ViewerOptions.new(args) tv = Viewer.new tv.config(.delete(:config)) if [:config] records = begin if [:name] tv.by_name([:name]) elsif [:month] tv.by_month([:month]) else tv.all end end if output = .delete(:output) Viewer.export(records, output[0], output[1]) else puts records end tv.close end |