Class: CLI
- Inherits:
-
Thor
- Object
- Thor
- CLI
- Defined in:
- bin/et
Instance Method Summary collapse
-
#initialize(a, b, c) ⇒ CLI
constructor
A new instance of CLI.
- #ls ⇒ Object
- #resume ⇒ Object
- #start(task_num) ⇒ Object
Constructor Details
#initialize(a, b, c) ⇒ CLI
Returns a new instance of CLI.
14 15 16 17 18 19 20 |
# File 'bin/et', line 14 def initialize(a, b, c) super(a, b, c) get_key! @tracker = EvadosTracker::Core.new(@key) check_unsaved_pomodoro check_for_response_error @tracker.get_tasks end |
Instance Method Details
#ls ⇒ Object
23 24 25 26 |
# File 'bin/et', line 23 def ls check_for_response_error @tracker.get_tasks @tracker.numerated_list.each {|t| puts "#{t[0]}. " + "#{t[1]['title']}"} end |
#resume ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'bin/et', line 43 def resume check_interrupt_rescue do @prev_issue = json_to_hash @tracker.current_issue_id = @prev_issue.keys.first begin do_pomodoro(@prev_issue[@prev_issue.keys.first]) end while [:a] end end |
#start(task_num) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'bin/et', line 30 def start(task_num) check_interrupt_rescue do @tracker.current_issue_id = @tracker.numerated_list["#{task_num}"]['id'] @prev_issue = { @tracker.current_issue_id => @tracker.numerated_list[task_num.to_s]['title'] } hash_to_json begin do_pomodoro(@tracker.numerated_list[task_num.to_s]['title']) end while [:a] end end |