class Rubinius::Debugger::Command::SetVariable

Public Instance Methods

run(args) click to toggle source
# File lib/rubinius/debugger/commands.rb, line 585
def run(args)
  var, val = args.split(/\s+/, 2)

  if val
    case val.strip
    when "true", "on", "yes", ""
      val = true
    when "false", "off", "no"
      val = false
    when "nil"
      val = nil
    when /\d+/
      val = val.to_i
    end
  else
    val = true
  end

  info "Set '#{var}' = #{val.inspect}"

  @debugger.variables[var.to_sym] = val
end