Class: Bitmapped::Cli
- Inherits:
-
Object
- Object
- Bitmapped::Cli
- Defined in:
- lib/bitmapped/cli.rb
Class Method Summary collapse
Class Method Details
.split_input(input) ⇒ Object
23 24 25 |
# File 'lib/bitmapped/cli.rb', line 23 def split_input(input) input.strip.split(' ') end |
.start ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bitmapped/cli.rb', line 8 def start begin bitmap = Bitmap.new puts "Bitmapped Command Centre (Ctrl+C to exit):" loop do input = split_input(Readline.readline("> ")) bitmap.command(input) end rescue Interrupt => interrupt puts "\nExiting..." exit end end |