Sha256: 5c4dc36d1e4d0285d81ba0ddf3ff5d37c4210ce88dbbffef21f621f58bd6f29b
Contents?: true
Size: 767 Bytes
Versions: 24
Compression:
Stored size: 767 Bytes
Contents
module Fog class Connection def initialize(url, persistent=false, params={}) Excon.defaults[:headers]['User-Agent'] ||= "fog/#{Fog::VERSION}" @excon = Excon.new(url, params) @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) params[:response_block] = lambda { |chunk, remaining, total| 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
24 entries across 24 versions & 9 rubygems