Class: Bitmapped::Cli

Inherits:
Object
  • Object
show all
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

.startObject



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