Sha256: 7eafd975b8e96fb1d8309d8bbc7dffca35d934c0318a80b206ad28fa9fb537e7
Contents?: true
Size: 919 Bytes
Versions: 18
Compression:
Stored size: 919 Bytes
Contents
module Debugger # Implements debugger "set_type" command class SetTypeCommand < Command self.need_context = true def regexp / ^\s* set_type? \s* (?:\s+(\S+))?\s* (?:\s+(\S+))?\s* $ /ix end def execute if RUBY_VERSION < "1.9" print_msg "Not implemented" return end begin expr = @match[1] + " = " + @match[2] + "(" + @match[1] + ".inspect)" eval(expr) rescue begin expr = @match[1] + " = " + @match[2] + ".new(" + @match[1] + ".inspect)" eval(expr) rescue nil end end end class << self def help_command %w[set_type] end def help(cmd) %{ set_type <var> <type> Change the type of <var> to <type> } end end end end
Version data entries
18 entries across 18 versions & 1 rubygems