Sha256: 2b8f8bb39e4b9b60dab58654e1482fb6fd8b3a7ef9b6fb3f9f1321b300612ec1

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

module Debugger
  class SetCommand < Command # :nodoc:
    self.control = true

    def regexp
      /^set \s+ (.+) \s*/x
    end

    def execute
      case @match[1]
      when /^(no)?autolist$/
        ListCommand.always_run = $1.nil?
        print "Listing is #{$1.nil? ? 'on' : 'off'}.\n"
      when /^(no)?autoeval$/
        EvalCommand.unknown = $1.nil?
        print "Evaluation of unrecognized command is #{$1.nil? ? 'on' : 'off'}.\n"
      when /^(no)?trace$/
        @@display_stack_trace = $1.nil?
        print "Display stack trace is #{$1.nil? ? 'on' : 'off'}.\n"
      else
        print "Unknown setting.\n"
      end
    end

    class << self
      def help_command
        "set"
      end

      def help(cmd)
        %{
           set <setting>, where <setting>:
           autolist - execute 'list' command on every breakpoint
           autoeval - evaluate every unrecognized command
           trace    - display stack trace when 'eval' raises exception
           To disable setting, use 'no' prefix, like 'noautolist'
         }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-debug-0.7.4-mswin32 lib/ruby-debug/commands/settings.rb
ruby-debug-0.7.3-mswin32 lib/ruby-debug/commands/settings.rb
ruby-debug-0.7.4 lib/ruby-debug/commands/settings.rb
ruby-debug-0.7.3 lib/ruby-debug/commands/settings.rb