Sha256: 08d6868c198c1a045b418e7a7f0e0578095967e0759954b316b386882b82909e
Contents?: true
Size: 1.16 KB
Versions: 39
Compression:
Stored size: 1.16 KB
Contents
module Debugger class ScriptCommand < Command # :nodoc: self.control = true def regexp /^\s*sc(?:ript)?\s+(.+)$/ end def execute unless File.exists?(@match[1]) print "Script file '#{@match[1]}' is not found\n" return end Debugger.run_script(@match[1], @state) end class << self def help_command 'script' end def help(cmd) %{ script FILE\texecutes a script file } end end end class SaveCommand < Command # :nodoc: self.control = true def regexp /^\s*sa(?:ve)?\s+(.+)$/ end def execute open(@match[1], 'w') do |file| Debugger.breakpoints.each do |b| file.puts "break #{b.source}:#{b.pos}#{" if #{b.expr}" if b.expr}" end file.puts "catch #{Debugger.catchpoint}" if Debugger.catchpoint end print "Saved to '#{@match[1]}'\n" end class << self def help_command 'save' end def help(cmd) %{ save FILE\tsaves current breakpoints and catchpoint as a script file } end end end end
Version data entries
39 entries across 39 versions & 1 rubygems