Sha256: d25b60bc9ba967f8cb24dedd8f2bad524056c3901f46104198fc3d3d588307ec

Contents?: true

Size: 920 Bytes

Versions: 60

Compression:

Stored size: 920 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

60 entries across 52 versions & 5 rubygems

Version Path
ruby-debug-ide-0.7.1.beta2 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.7.1.beta1 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.7.0 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-docker-0.6.1 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.7.0.beta7 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.7.0.beta6 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.7.0.beta4 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.7.0.beta3 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.7.0.beta2 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.1 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.1.beta12 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.1.beta11 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.1.beta9 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.1.beta8 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.1.beta7 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.1.beta6 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.1.beta4 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.1.beta3 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.1.beta2 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.6.0 lib/ruby-debug-ide/commands/set_type.rb