Sha256: 4434c3dad1300a9b3069955a1aa969cd0903490db6f11b994d79d4b1376dedcf

Contents?: true

Size: 591 Bytes

Versions: 151

Compression:

Stored size: 591 Bytes

Contents

# Keep this file meanwhile https://github.com/rack/rack/pull/313 is not released
module ActionDispatch
  class BodyProxy
    def initialize(body, &block)
      @body, @block, @closed = body, block, false
    end

    def respond_to?(*args)
      super or @body.respond_to?(*args)
    end

    def close
      return if @closed
      @closed = true
      begin
        @body.close if @body.respond_to? :close
      ensure
        @block.call
      end
    end

    def closed?
      @closed
    end

    def method_missing(*args, &block)
      @body.__send__(*args, &block)
    end
  end
end

Version data entries

151 entries across 112 versions & 18 rubygems

Version Path
actionpack-3.2.22.5 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.22.4 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.22.3 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.22.2 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.22.1 lib/action_dispatch/middleware/body_proxy.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.22 lib/action_dispatch/middleware/body_proxy.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.12/lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.21 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.20 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.19 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.18 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.17 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.16 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.15 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.15.rc3 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.15.rc2 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.15.rc1 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.14 lib/action_dispatch/middleware/body_proxy.rb
actionpack-3.2.14.rc2 lib/action_dispatch/middleware/body_proxy.rb