/usr/lib/ruby/1.8/merb-core/rack/stream_wrapper.rb is in libmerb-core-ruby1.8 1.0.12+dfsg-4fakesync1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | module Merb
module Rack
class StreamWrapper
# :api: private
def initialize(body)
@body = body
end
# :api: private
def each(&callback)
if Proc === @body
@writer = lambda { |x| callback.call(x) }
@body.call(self)
elsif @body.is_a?(String)
@body.each_line(&callback)
else
@body.each(&callback)
end
end
# :api: private
def write(str)
@writer.call str.to_s
str
end
# :api: private
def to_s
@body.to_s
end
# :api: private
def ==(other)
@body == other
end
# :api: private
def method_missing(sym, *args, &blk)
@body.send(sym, *args, &blk)
end
end
end
end
|