Sha256: 5269e6d6f26de97a3516e6607c4737d94977f870d13ab88f7c0a4bc07fc9d051

Contents?: true

Size: 763 Bytes

Versions: 43

Compression:

Stored size: 763 Bytes

Contents

module Debugger
  # Implements debugger "source" command.
  class SourceCommand < Command
    self.allow_in_control = true
    
    def regexp
      /^\s* so(?:urce)? \s+ (.+) $/x
    end
    
    def execute
      file = File.expand_path(@match[1]).strip
      unless File.exist?(file)
        errmsg "Command file '#{file}' is not found\n"
        return
      end
      if @state and @state.interface
        @state.interface.command_queue += File.open(file).readlines
      else
        Debugger.run_script(file, @state)
      end
    end
    
    class << self
      def help_command
        'source'
      end
      
      def help(cmd)
        %{
          source FILE\texecutes a file containing debugger commands
        }
      end
    end
  end
  
end

Version data entries

43 entries across 43 versions & 10 rubygems

Version Path
ruby-debug-0.11.0 cli/ruby-debug/commands/source.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/ruby-debug-0.10.6/cli/ruby-debug/commands/source.rb
ruby-debug-0.10.6 cli/ruby-debug/commands/source.rb
ruby-debug-0.10.5.rc9 cli/ruby-debug/commands/source.rb
ruby-debug-0.10.5.rc8 cli/ruby-debug/commands/source.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/source.rb
ruby-debug-0.10.5.rc7 cli/ruby-debug/commands/source.rb
ruby-debug-0.10.5.rc5 cli/ruby-debug/commands/source.rb
ruby-debug-0.10.5.rc4 cli/ruby-debug/commands/source.rb
debugger2-1.0.0.beta2 lib/ruby-debug/commands/source.rb
debugger2-1.0.0.beta1 lib/ruby-debug/commands/source.rb
needy_debugger-1.4.0 lib/ruby-debug/commands/source.rb
debugger-1.4.0 lib/ruby-debug/commands/source.rb
debugger-1.3.3 lib/ruby-debug/commands/source.rb
debugger-1.3.2 lib/ruby-debug/commands/source.rb
debugger-1.3.1 lib/ruby-debug/commands/source.rb
debugger-1.3.0 lib/ruby-debug/commands/source.rb
debugger-1.2.4 lib/ruby-debug/commands/source.rb
debugger-1.2.3 lib/ruby-debug/commands/source.rb
ruby-debug-0.10.5.rc3 cli/ruby-debug/commands/source.rb