Sha256: d0abd0fc87c64ff0ca44c5761a13f1a5c4566e65cc6f01ee1d72d245ec5e78f3

Contents?: true

Size: 500 Bytes

Versions: 121

Compression:

Stored size: 500 Bytes

Contents

module Rack
  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

121 entries across 102 versions & 13 rubygems

Version Path
classicCMS-0.2.3 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
classicCMS-0.2.2 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
classicCMS-0.2.1 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
classicCMS-0.2.0 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
classicCMS-0.1.2 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.5.3 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.5.2 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.5.1 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.5.0 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.4.1 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.4.0 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.3.5 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.3.4 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.3.3 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.3.2 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.3.1 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.3.0 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.2.1 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.2.0 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb