Sha256: 9481439be0305dbee39699126985cba4ad347bb4d402118ba676cc4b9e148273

Contents?: true

Size: 841 Bytes

Versions: 6

Compression:

Stored size: 841 Bytes

Contents

module Trepan
  # Implements debugger "reload" command.
  class ReloadCommand < OldCommand
    self.allow_in_control = true

    register_setting_get(:reload_source_on_change) do 
      Debugger.reload_source_on_change
    end
    register_setting_set(:reload_source_on_change) do |value|
      Debugger.reload_source_on_change = value
    end
    
    def regexp
      /^\s*r(?:eload)?$/
    end
    
    def execute
      Debugger.source_reload
      print "Source code is reloaded. Automatic reloading is #{source_reloading}.\n"
    end
    
    private
    
    def source_reloading
      Debugger.reload_source_on_change ? 'on' : 'off'
    end
    
    class << self
      def help_command
        'reload'
      end

      def help(cmd)
        %{
          r[eload]\tforces source code reloading
        }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rb8-trepanning-0.1.6 processor/command-ruby-debug/reload.rb
rb8-trepanning-0.1.5 processor/command-ruby-debug/reload.rb
rb8-trepanning-0.1.4 processor/command-ruby-debug/reload.rb
rb8-trepanning-0.1.3 processor/command-ruby-debug/reload.rb
rb8-trepanning-0.1.3-universal-ruby-1.9.2 processor/command-ruby-debug/reload.rb
rb8-trepanning-0.1.3-universal-ruby-1.8.7 processor/command-ruby-debug/reload.rb