e3832c6f79
Upgrade to Rails 2.3.5. Also work around this bug: https://rails.lighthouseapp.com/projects/8994/tickets/3524 created by the aforementioned Rails release.
30 lines
539 B
Ruby
30 lines
539 B
Ruby
module ActionController
|
|
class StringCoercion
|
|
class UglyBody < ActiveSupport::BasicObject
|
|
def initialize(body)
|
|
@body = body
|
|
end
|
|
|
|
def each
|
|
@body.each do |part|
|
|
yield part.to_s
|
|
end
|
|
end
|
|
|
|
private
|
|
def method_missing(*args, &block)
|
|
@body.__send__(*args, &block)
|
|
end
|
|
end
|
|
|
|
def initialize(app)
|
|
@app = app
|
|
end
|
|
|
|
def call(env)
|
|
status, headers, body = @app.call(env)
|
|
[status, headers, UglyBody.new(body)]
|
|
end
|
|
end
|
|
end
|