Sha256: 1da0ef1abdb8ab535cd5c509b300c426b876e1dd6736dc7f482d8d785f3f5587

Contents?: true

Size: 765 Bytes

Versions: 8

Compression:

Stored size: 765 Bytes

Contents

# Monkey patch to handle the case where Content-Type headers returned by servers
# say "gzip" by the resulting message body isn't in gzip format.
# TODO Remove this when we upgrade Berkshelf and the gzip response goes away.
# https://github.com/berkshelf/berkshelf-api-client/blob/v1.3.0/lib/berkshelf/api_client/connection.rb#L37
require 'faraday_middleware'

module FaradayMiddleware
  class Gzip
    alias_method :__uncompress_gzip__, :uncompress_gzip
    def uncompress_gzip(body)
      __uncompress_gzip__(body)
    rescue Zlib::GzipFile::Error
      StringIO.new(body).read
    end
  end
end

Faraday::Response.register_middleware :gzip => FaradayMiddleware::Gzip

# Force Berkshelf to use the gecode dependency solver
require 'solve'

Solve.engine = :gecode

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
builderator-1.1.7 lib/builderator/patch/berkshelf.rb
builderator-1.1.6 lib/builderator/patch/berkshelf.rb
builderator-1.1.5 lib/builderator/patch/berkshelf.rb
builderator-1.1.4 lib/builderator/patch/berkshelf.rb
builderator-1.1.3 lib/builderator/patch/berkshelf.rb
builderator-1.1.2 lib/builderator/patch/berkshelf.rb
builderator-1.1.1 lib/builderator/patch/berkshelf.rb
builderator-1.1.0 lib/builderator/patch/berkshelf.rb