Module: Probatio::DebugMethods
- Included in:
- Probatio
- Defined in:
- lib/probatio/debug.rb
Instance Method Summary collapse
Instance Method Details
#dbg_m(*as, &block) ⇒ Object
24 25 26 27 |
# File 'lib/probatio/debug.rb', line 24 def dbg_m(*as, &block) debug(:m, *as, &block) end |
#dbg_s(*as, &block) ⇒ Object
19 20 21 22 |
# File 'lib/probatio/debug.rb', line 19 def dbg_s(*as, &block) debug(:s, *as, &block) end |
#debug(*as, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/probatio/debug.rb', line 9 def debug(*as, &block) return unless $_PROBATIO_DEBUG.include?(as.shift) $stderr.print $_PROBATIO_COLOURS.green $stderr.puts(*as) if as.any? $stderr.puts block.call if block $stderr.print $_PROBATIO_COLOURS.reset end |