Class: Pello::Runner
- Inherits:
-
Object
- Object
- Pello::Runner
- Defined in:
- lib/pello/runner.rb
Instance Attribute Summary collapse
-
#board_url ⇒ Object
Returns the value of attribute board_url.
-
#list_name ⇒ Object
Returns the value of attribute list_name.
-
#log_file_path ⇒ Object
Returns the value of attribute log_file_path.
-
#prompt ⇒ Object
Returns the value of attribute prompt.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run! ⇒ Object
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
15 16 17 18 |
# File 'lib/pello/runner.rb', line 15 def initialize @prompt = TTY::Prompt.new configure_pello end |
Instance Attribute Details
#board_url ⇒ Object
Returns the value of attribute board_url.
13 14 15 |
# File 'lib/pello/runner.rb', line 13 def board_url @board_url end |
#list_name ⇒ Object
Returns the value of attribute list_name.
13 14 15 |
# File 'lib/pello/runner.rb', line 13 def list_name @list_name end |
#log_file_path ⇒ Object
Returns the value of attribute log_file_path.
13 14 15 |
# File 'lib/pello/runner.rb', line 13 def log_file_path @log_file_path end |
#prompt ⇒ Object
Returns the value of attribute prompt.
13 14 15 |
# File 'lib/pello/runner.rb', line 13 def prompt @prompt end |
#username ⇒ Object
Returns the value of attribute username.
13 14 15 |
# File 'lib/pello/runner.rb', line 13 def username @username end |
Instance Method Details
#run! ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/pello/runner.rb', line 20 def run! continue = true while continue case prompt.select('Choose task') do || .choice name: 'Add pomodori', value: :add_pomodori .choice name: 'Move card', value: :move_card .choice name: 'Print board pomodori report', value: :report .choice name: 'Edit config', value: :edit_config .choice name: 'quit', value: :quit end when :add_pomodori add_pomodori_to_card when :move_card move_card when :report report when :edit_config editor = ENV['EDITOR'] || 'vim' system 'mkdir -p ~/.config/pello' system "#{editor} ~/.config/pello/pello.yaml" when :quit puts 'Ok, bye!' exit end end end |