Module: BlackStack::Debugging
- Defined in:
- lib/functions.rb
Overview
PRY Supporting Functions
Constant Summary collapse
- @@allow_breakpoints =
false- @@verbose =
false
Class Method Summary collapse
-
.allow_breakpoints ⇒ Object
return true if breakpoints are allowed.
-
.set(h) ⇒ Object
set breakpoints allowed if the hash contains a key :allow_breakpoints with a value of true.
Class Method Details
.allow_breakpoints ⇒ Object
return true if breakpoints are allowed
329 330 331 |
# File 'lib/functions.rb', line 329 def self.allow_breakpoints @@allow_breakpoints end |
.set(h) ⇒ Object
set breakpoints allowed if the hash contains a key :allow_breakpoints with a value of true
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/functions.rb', line 334 def self.set(h) @@allow_breakpoints = h[:allow_breakpoints] if h[:allow_breakpoints].is_a?(TrueClass) @@verbose = h[:verbose] if h[:verbose].is_a?(TrueClass) if !@@allow_breakpoints # monkey patching the pry method to not break on breakpoints new_pry = lambda do print "Breakpoint are not allowed" if @@verbose end Binding.class_eval do alias_method :old_pry, :pry define_method :pry, new_pry end end end |