Class: RabbitHole::CLI
- Inherits:
-
Thor
- Object
- Thor
- RabbitHole::CLI
- Defined in:
- lib/rabbit_hole/cli.rb
Instance Method Summary collapse
Instance Method Details
#add(task) ⇒ Object
6 7 8 9 10 |
# File 'lib/rabbit_hole/cli.rb', line 6 def add(task) stack = Base.new stack.push task puts "Added task '#{task}' to the stack!" end |
#complete ⇒ Object
19 20 21 22 23 |
# File 'lib/rabbit_hole/cli.rb', line 19 def complete stack = Base.new puts "Completed: '#{stack.pop}'" puts "Next task: '#{stack.top}'" end |
#current ⇒ Object
13 14 15 16 |
# File 'lib/rabbit_hole/cli.rb', line 13 def current stack = Base.new puts "Currently working on: '#{stack.top}'" end |
#show ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/rabbit_hole/cli.rb', line 26 def show stack = Base.new tasks = stack.tasks puts "#{tasks.size} levels deep" puts "Current task: #{tasks.last}" tasks[0...-1].each do |task| puts task end end |