==( other )
click to toggle source
def ==( other )
StringPort === other and @buffer.equal? other.string
end
aopen( &block )
click to toggle source
def aopen( &block )
@buffer ||= ''
StringOutput.new(@buffer, &block)
end
copy_to( port )
click to toggle source
def copy_to( port )
port.wopen {|f|
f.write @buffer
}
end
cp( port )
click to toggle source
eql?( other )
click to toggle source
hash()
click to toggle source
def hash
@buffer.object_id.hash
end
inspect()
click to toggle source
def inspect
"#<#{self.class}:id=#{sprintf '0x%x', @buffer.object_id}>"
end
move_to( port )
click to toggle source
def move_to( port )
if StringPort === port
str = @buffer
port.instance_eval { @buffer = str }
else
copy_to port
end
remove
end
read_all()
click to toggle source
remove()
click to toggle source
def remove
@buffer = nil
end
reproducible?()
click to toggle source
def reproducible?
true
end
rm()
click to toggle source
ropen( &block )
click to toggle source
def ropen( &block )
@buffer or raise Errno::ENOENT, "#{inspect} is already removed"
StringInput.open(@buffer, &block)
end
size()
click to toggle source
def size
@buffer.size
end
string()
click to toggle source
to_s()
click to toggle source
wopen( &block )
click to toggle source
def wopen( &block )
@buffer = ''
StringOutput.new(@buffer, &block)
end