Module: Capistrano::OutputCatcher::Base

Defined in:
lib/capistrano/ext/output_catcher.rb

Instance Method Summary collapse

Instance Method Details

#capture_output(out = StringIO.new, err = nil) ⇒ Object



47
48
49
50
51
# File 'lib/capistrano/ext/output_catcher.rb', line 47

def capture_output(out = StringIO.new, err = nil)
  create_capture_channels(out, err)
  reroute_original_channels
  override_output_channels(out, err)
end

#end_captureObject



59
60
61
62
63
# File 'lib/capistrano/ext/output_catcher.rb', line 59

def end_capture
  out_output = $capstd.out.string
  err_output = $capstd.err.string
  $capoutput = [ out_output, err_output ]
end

#tee_output(out = StringIO.new, err = nil) ⇒ Object



53
54
55
56
57
# File 'lib/capistrano/ext/output_catcher.rb', line 53

def tee_output(out = StringIO.new, err = nil)
  create_capture_channels(out, err)
  reroute_original_channels
  override_output_channels(TeeIO.new($std.out, out), TeeIO.new($std.err, err))
end