Sha256: 29c125680b95211ac14bcd36ae7bba3c9cb186114d0e0b648989ee50d62730a5

Contents?: true

Size: 642 Bytes

Versions: 28

Compression:

Stored size: 642 Bytes

Contents

unless Fog.mocking?

  module Fog
    class Connection

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

      def request(params)
        if parser = params.delete(:parser)
          body = Nokogiri::XML::SAX::PushParser.new(parser)
          params[:block] = lambda { |chunk| body << chunk }
        end

        response = @excon.request(params)

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

        response
      end

    end
  end

else

  module Fog
    class Connection

      def initialize(url)
      end

      def request(params)
      end

    end
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
fog-0.0.58 lib/fog/connection.rb
fog-0.0.57 lib/fog/connection.rb
fog-0.0.56 lib/fog/connection.rb
fog-0.0.55 lib/fog/connection.rb
fog-0.0.54 lib/fog/connection.rb
fog-0.0.53 lib/fog/connection.rb
fog-0.0.52 lib/fog/connection.rb
fog-0.0.51 lib/fog/connection.rb
fog-0.0.50 lib/fog/connection.rb
fog-0.0.49 lib/fog/connection.rb
fog-0.0.48 lib/fog/connection.rb
fog-0.0.47 lib/fog/connection.rb
fog-0.0.46 lib/fog/connection.rb
fog-0.0.45 lib/fog/connection.rb
fog-0.0.44 lib/fog/connection.rb
fog-0.0.43 lib/fog/connection.rb
fog-0.0.42 lib/fog/connection.rb
fog-0.0.41 lib/fog/connection.rb
fog-0.0.40 lib/fog/connection.rb
fog-0.0.39 lib/fog/connection.rb