Skip to content

Instantly share code, notes, and snippets.

@no6v
Created October 26, 2009 18:11
Show Gist options
  • Save no6v/218887 to your computer and use it in GitHub Desktop.
Save no6v/218887 to your computer and use it in GitHub Desktop.
module Rack
class Lint
unless method_defined?(:call_with_close)
def call_with_close(env = nil)
call_without_close(env).tap do |status, headers, body|
body.close if body.respond_to?(:close)
end
end
alias_method_chain :call, :close
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment