summary refs log tree commit homepage
path: root/lib/rainbows/dev_fd_response.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-06-21 05:54:06 +0000
committerEric Wong <normalperson@yhbt.net>2010-06-21 06:00:11 +0000
commitf64a6781cbfbde40e4be6334520b1ff06a5e5626 (patch)
tree8bd3a897cecac9549606ada61520588cb5226001 /lib/rainbows/dev_fd_response.rb
parenta4a3fbb761e5ae4f36e9dd84ad933c6df63975ba (diff)
We can't use it effectively in Rubinius yet, and it's
broken due to the issue described in:
  http://github.com/evanphx/rubinius/issues/379
Diffstat (limited to 'lib/rainbows/dev_fd_response.rb')
-rw-r--r--lib/rainbows/dev_fd_response.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/rainbows/dev_fd_response.rb b/lib/rainbows/dev_fd_response.rb
index 0489fd6..cb57419 100644
--- a/lib/rainbows/dev_fd_response.rb
+++ b/lib/rainbows/dev_fd_response.rb
@@ -8,9 +8,20 @@ module Rainbows
   # objects.  This may be used in conjunction with the #to_path method
   # on servers that support it to pass arbitrary file descriptors into
   # the HTTP response without additional open(2) syscalls
+  #
+  # This middleware is currently a no-op for Rubinius, as it lacks
+  # IO.copy_stream in 1.9 and also due to a bug here:
+  #   http://github.com/evanphx/rubinius/issues/379
 
   class DevFdResponse < Struct.new(:app)
+
     # :stopdoc:
+    #
+    # make this a no-op under Rubinius, it's pointless anyways
+    # since Rubinius doesn't have IO.copy_stream
+    def self.new(app)
+      app
+    end if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
     include Rack::Utils
 
     # Rack middleware entry point, we'll just pass through responses