Sha256: 3a62a0b174a865cbb5b1994a577340a1f2267b41c32e65471f0f6588ca094f25

Contents?: true

Size: 641 Bytes

Versions: 67

Compression:

Stored size: 641 Bytes

Contents

module Fog
  class Connection

    def initialize(url, persistent=false)
      @excon = Excon.new(url)
      @persistent = persistent
    end

    def request(params, &block)
      unless @persistent
        reset
      end
      unless block_given?
        if (parser = params.delete(:parser))
          body = Nokogiri::XML::SAX::PushParser.new(parser)
          block = lambda { |chunk| body << chunk }
        end
      end

      response = @excon.request(params, &block)

      if parser
        body.finish
        response.body = parser.response
      end

      response
    end

    def reset
      @excon.reset
    end

  end
end

Version data entries

67 entries across 67 versions & 3 rubygems

Version Path
fog-0.4.0 lib/fog/core/connection.rb
fog-0.3.34 lib/fog/core/connection.rb
fog-0.3.33 lib/fog/core/connection.rb
fog-0.3.32 lib/fog/core/connection.rb
fog-0.3.31 lib/fog/core/connection.rb
fog-0.3.30 lib/fog/core/connection.rb
fog-0.3.29 lib/fog/core/connection.rb
fog-0.3.28 lib/fog/core/connection.rb
fog-0.3.27 lib/fog/core/connection.rb
fog-0.3.26 lib/fog/core/connection.rb
fog-0.3.25 lib/fog/core/connection.rb
fog-0.3.24 lib/fog/core/connection.rb
bbcloud-0.8.1 lib/bbcloud/vendor/fog-0.3.23/lib/fog/core/connection.rb
fog-0.3.23 lib/fog/core/connection.rb
fog-0.3.22 lib/fog/core/connection.rb
fog-0.3.21 lib/fog/core/connection.rb
fog-0.3.20 lib/fog/core/connection.rb
fog-0.3.19 lib/fog/core/connection.rb
fog-0.3.18 lib/fog/core/connection.rb
fog-0.3.17 lib/fog/core/connection.rb