diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-07-04 22:16:52 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-07-04 22:34:09 +0000 |
commit | 39b178cdebe275cbc8ce19cf269bea7cd15ff4ca (patch) | |
tree | b7628ed278895fcf70ea3206956be586ac9e1ac5 /lib/rainbows.rb | |
parent | 75f5aa9a0d6b37a94afbea3121fc2c16e70a2b1d (diff) | |
download | rainbows-39b178cdebe275cbc8ce19cf269bea7cd15ff4ca.tar.gz |
This hopefully allows the "sendfile" gem to be required anywhere in the Rainbows!/Unicorn config file, and not have to be required via RUBYOPT or the '-r' command-line switch. We also modularize HttpResponse and avoids singleton methods in the response path. This (hopefully) makes it easier for individual concurrency models to share code and override individual methods.
Diffstat (limited to 'lib/rainbows.rb')
-rw-r--r-- | lib/rainbows.rb | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb index 9e5b8a9..906806f 100644 --- a/lib/rainbows.rb +++ b/lib/rainbows.rb @@ -122,20 +122,4 @@ module Rainbows end # :startdoc: autoload :Fiber, 'rainbows/fiber' # core class - - # to_io is not part of the Rack spec, but make an exception here - # since we can conserve path lookups and file descriptors - # \Rainbows! will never get here without checking for the existence - # of body.to_path first. - def self.body_to_io(body) - if body.respond_to?(:to_io) - body.to_io - else - # try to take advantage of Rainbows::DevFdResponse, calling File.open - # is a last resort - path = body.to_path - path =~ %r{\A/dev/fd/(\d+)\z} ? IO.new($1.to_i) : File.open(path, 'rb') - end - end - end |