Skip to content

Instantly share code, notes, and snippets.

@maiha
Created January 11, 2009 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maiha/45809 to your computer and use it in GitHub Desktop.
Save maiha/45809 to your computer and use it in GitHub Desktop.
diff --git a/merb-core/lib/merb-core/rack/stream_wrapper.rb b/merb-core/lib/merb-core/rack/stream_wrapper.rb
index d11a141..ec6ce2c 100644
--- a/merb-core/lib/merb-core/rack/stream_wrapper.rb
+++ b/merb-core/lib/merb-core/rack/stream_wrapper.rb
@@ -14,8 +14,10 @@ module Merb
@body.call(self)
elsif @body.is_a?(String)
@body.each_line(&callback)
- else
+ elsif @body.respond_to?(:each)
@body.each(&callback)
+ else
+ callback.call(@body.to_s)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment