Sha256: 25e8febbc2031026e384c31c050560778a44ac5907d4f0a889bca0ce7eaf12ed

Contents?: true

Size: 927 Bytes

Versions: 10

Compression:

Stored size: 927 Bytes

Contents

module Debugger
  # Implements debugger "source" command.
  class SourceCommand < Command
    self.allow_in_control = true
    
    def regexp
      /^\s* so(?:urce)? (\s+ -v)? \s+ (.+) $/x
    end
    
    def execute
      if 3 == @match.size then
        verbose=true
        file=@match[2]
      else
        verbose=false
        file=@match[1]
      end
        
      file = File.expand_path(file).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, verbose)
      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

10 entries across 10 versions & 3 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/source.RB
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/source.RB
vim-jar-0.1.2 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/source.RB
vim-jar-0.1.1 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/source.RB
vim-jar-0.1.0 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/source.RB
vim-jar-0.0.3 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/source.RB
vim-jar-0.0.2 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/source.RB
vim-jar-0.0.1 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/source.RB
ruby-debug-0.10.4 cli/ruby-debug/commands/source.RB
ruby-debug-0.10.3 cli/ruby-debug/commands/source.RB