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.
219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/byebug.rb', line 219 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.
236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/byebug.rb', line 236 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 |