Module: Topo::Output

Included in:
Provision::NodeGroupGenerator
Defined in:
lib/topo/utils/output.rb

Instance Method Summary collapse

Instance Method Details

#divert_stdoutObject



24
25
26
27
28
29
30
31
# File 'lib/topo/utils/output.rb', line 24

def divert_stdout
   previous_stdout, $stdout = $stdout, StringIO.new
   yield
   $stdout.string
 ensure
   # Restore the previous value of stdout
   $stdout = previous_stdout || STDOUT
end