Module: Nrb::Utils
- Defined in:
- lib/nrb/utils.rb
Overview
Utility methods to be used in other places.
Class Method Summary collapse
-
.console ⇒ Object
Use Pry if available.
-
.silently ⇒ Object
Supress STDOUT for the duration of the block.
Class Method Details
.console ⇒ Object
Use Pry if available
15 16 17 |
# File 'lib/nrb/utils.rb', line 15 def console defined?(Pry) ? Pry : IRB end |
.silently ⇒ Object
Supress STDOUT for the duration of the block.
7 8 9 10 11 12 |
# File 'lib/nrb/utils.rb', line 7 def silently original = $stdout.dup $stdout.reopen(File::NULL) yield $stdout.reopen(original) end |