Class: Module
- Inherits:
-
Object
- Object
- Module
- Defined in:
- lib/ruby-debug.rb
Instance Method Summary collapse
-
#debug_method(meth) ⇒ Object
Wraps the
meth
method with Debugger.start … block. -
#post_mortem_method(meth) ⇒ Object
Wraps the
meth
method with Debugger.post_mortem … block.
Instance Method Details
#debug_method(meth) ⇒ Object
Wraps the meth
method with Debugger.start … block.
297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/ruby-debug.rb', line 297 def debug_method(meth) old_meth = "__debugee_#{meth}" old_meth = "#{$1}_set" if old_meth =~ /^(.+)=$/ alias_method old_meth.to_sym, meth class_eval <<-EOD def #{meth}(*args, &block) Debugger.start do debugger 2 #{old_meth}(*args, &block) end end EOD end |
#post_mortem_method(meth) ⇒ Object
Wraps the meth
method with Debugger.post_mortem … block.
314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/ruby-debug.rb', line 314 def post_mortem_method(meth) old_meth = "__postmortem_#{meth}" old_meth = "#{$1}_set" if old_meth =~ /^(.+)=$/ alias_method old_meth.to_sym, meth class_eval <<-EOD def #{meth}(*args, &block) Debugger.start do |dbg| dbg.post_mortem do #{old_meth}(*args, &block) end end end EOD end |