Skip to content

Instantly share code, notes, and snippets.

@duncanbeevers
Created September 29, 2010 21:29
Show Gist options
  • Save duncanbeevers/603602 to your computer and use it in GitHub Desktop.
Save duncanbeevers/603602 to your computer and use it in GitHub Desktop.
require 'stringio'
class Capistrano::Logger
class StringIOProxy < StringIO
def initialize(proxy_target)
@proxy_target = proxy_target
super('')
end
def write(*args)
@proxy_target.write(*args)
super(*args)
end
end
def proxy_device
@proxy_device ||= StringIOProxy.new(@device)
end
def device
proxy_device
end
def history
proxy_device.rewind
proxy_device.read
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment