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.7.5 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
classiccms-0.7.4 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
classiccms-0.7.3 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
classiccms-0.7.2 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
classiccms-0.7.1 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
classiccms-0.7.0 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-0.9.0 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
classiccms-0.6.9 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
jquery_regex-0.0.3 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
jquery_regex-0.0.1 vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/rack-1.4.1/lib/rack/body_proxy.rb