Parent

Class/Module Index [+]

Quicksearch

PhusionPassenger::Utils::PseudoIO

Wraps another IO object. Everything written to the PseudoIO will not only be immediately forwarded to the underlying IO object but will also be captured in a buffer. The contents of the buffer can be retrieved by calling done!.

Public Class Methods

new(sink) click to toggle source
# File lib/phusion_passenger/utils.rb, line 518
def initialize(sink)
        @sink = sink || File.open("/dev/null", "w")
        @buffer = StringIO.new
end

Public Instance Methods

done!() click to toggle source
# File lib/phusion_passenger/utils.rb, line 523
def done!
        result = @buffer.string
        @buffer = nil
        return result
end
method_missing(*args, &block) click to toggle source
# File lib/phusion_passenger/utils.rb, line 533
def method_missing(*args, &block)
        @buffer.send(*args, &block) if @buffer && args.first != :reopen
        return @sink.send(*args, &block)
end
respond_to?(symbol, include_private = false) click to toggle source
# File lib/phusion_passenger/utils.rb, line 538
def respond_to?(symbol, include_private = false)
        return @sink.respond_to?(symbol, include_private)
end
to_io() click to toggle source
# File lib/phusion_passenger/utils.rb, line 529
def to_io
        return self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.