Class: Day::Tracker::Cli
- Inherits:
-
Thor
- Object
- Thor
- Day::Tracker::Cli
- Defined in:
- lib/day/tracker.rb
Constant Summary collapse
- FILE_PATH =
File.("~/day-tracker")
Instance Method Summary collapse
- #add(project_name) ⇒ Object
-
#initialize(*args) ⇒ Cli
constructor
A new instance of Cli.
- #list ⇒ Object
Constructor Details
Instance Method Details
#add(project_name) ⇒ Object
19 20 21 22 23 |
# File 'lib/day/tracker.rb', line 19 def add(project_name) open(FILE_PATH, 'a') do |file| file.puts Time.now.strftime("%B %d - #{project_name}") end end |
#list ⇒ Object
14 15 16 |
# File 'lib/day/tracker.rb', line 14 def list puts File.read(FILE_PATH) end |