Sha256: 11cffc17fa3b109b81488af3574ba81f06492c91175069b0288b713f522f085a

Contents?: true

Size: 429 Bytes

Versions: 11

Compression:

Stored size: 429 Bytes

Contents

require 'faraday_middleware/response_middleware'

module Httply
  module Middlewares
    # Public: parses response bodies with Nokogiri.
    class ParseHtml < ::FaradayMiddleware::ResponseMiddleware
      dependency 'nokogiri'

      define_parser do |body, parser_options|
        ::Nokogiri::HTML(body, nil, "utf-8")
      end
    end
  end
end

# deprecated alias
Faraday::Response::ParseHtml = Httply::Middlewares::ParseHtml

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
httply-0.2.0 lib/httply/middlewares/html.rb
httply-0.1.9 lib/httply/middlewares/html.rb
httply-0.1.8 lib/httply/middlewares/html.rb
httply-0.1.7 lib/httply/middlewares/html.rb
httply-0.1.6 lib/httply/middlewares/html.rb
httply-0.1.5 lib/httply/middlewares/html.rb
httply-0.1.4 lib/httply/middlewares/html.rb
httply-0.1.3 lib/httply/middlewares/html.rb
httply-0.1.2 lib/httply/middlewares/html.rb
httply-0.1.1 lib/httply/middlewares/html.rb
httply-0.1.0 lib/httply/middlewares/html.rb