Class: PhusionPassenger::Utils::PseudoIO
- Inherits:
-
Object
- Object
- PhusionPassenger::Utils::PseudoIO
show all
- Defined in:
- lib/phusion_passenger/utils.rb
Instance Method Summary
collapse
Constructor Details
#initialize(sink) ⇒ PseudoIO
Returns a new instance of PseudoIO.
515
516
517
518
|
# File 'lib/phusion_passenger/utils.rb', line 515
def initialize(sink)
@sink = sink || File.open("/dev/null", "w")
@buffer = StringIO.new
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
526
527
528
529
|
# File 'lib/phusion_passenger/utils.rb', line 526
def method_missing(*args, &block)
@buffer.send(*args, &block) if @buffer && args.first != :reopen
return @sink.send(*args, &block)
end
|
Instance Method Details
520
521
522
523
524
|
# File 'lib/phusion_passenger/utils.rb', line 520
def done!
result = @buffer.string
@buffer = nil
return result
end
|
#respond_to?(symbol, include_private = false) ⇒ Boolean
531
532
533
|
# File 'lib/phusion_passenger/utils.rb', line 531
def respond_to?(symbol, include_private = false)
return @sink.respond_to?(symbol, include_private)
end
|