Class: Module
- Inherits:
-
Object
- Object
- Module
- Defined in:
- lib/byebug.rb
Instance Method Summary collapse
-
#debug_method(meth) ⇒ Object
Wraps the
meth
method with Byebug.start … block. -
#post_mortem_method(meth) ⇒ Object
Wraps the
meth
method with Byebug.post_mortem … block.
Instance Method Details
#debug_method(meth) ⇒ Object
Wraps the meth
method with Byebug.start … block.
214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/byebug.rb', line 214 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) Byebug.start do byebug 2 #{old_meth}(*args, &block) end end EOD end |
#post_mortem_method(meth) ⇒ Object
Wraps the meth
method with Byebug.post_mortem … block.
231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/byebug.rb', line 231 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) Byebug.start do |dbg| dbg.post_mortem do #{old_meth}(*args, &block) end end end EOD end |