Module: Console::Warn
- Defined in:
- lib/console/warn.rb
Overview
Redirect warnings to Console.warn.
Instance Method Summary collapse
- 
  
    
      #warn(message, **options)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Redirect warnings to warn. 
Instance Method Details
#warn(message, **options) ⇒ Object
Redirect warnings to Console.warn.
| 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # File 'lib/console/warn.rb', line 15 def warn(, **) fiber = Fiber.current # We do this to be extra pendantic about avoiding infinite recursion. return super if fiber.console_warn begin fiber.console_warn = true .chomp! Console::Logger.instance.warn(, **) ensure fiber.console_warn = false end end |