Class: Module
- Inherits:
-
Object
- Object
- Module
- Defined in:
- lib/ruby-debug-base.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.
200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/ruby-debug-base.rb', line 200 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.
217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/ruby-debug-base.rb', line 217 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 |