Method: CommandButler::Input.start

Defined in:
lib/command_butler/input.rb

.startObject



27
28
29
30
31
32
33
34
35
# File 'lib/command_butler/input.rb', line 27

def self.start
  while(true)
    puts "[#{Dir.pwd}] $ execute Enter (no: n, quit: q, jump : command-number, skip : s)\n"
    input_value = STDIN.gets.chomp
    input_value = 'y' if input_value == "" # エンターの実行はyと同じにする
    return self.new(input_value:input_value) if constant_inputs? input_value
    return self.new(input_value:input_value.to_i) if input_value.to_i.nonzero? # jumpコマンド
  end
end