Sha256: f7cdf82c14216c65ccb36b3a692f07c2fb98bd548dbed40b2706a54b7fb63b02

Contents?: true

Size: 401 Bytes

Versions: 22

Compression:

Stored size: 401 Bytes

Contents

module Pupa
  class Processor
    module Middleware
      # A Faraday response middleware for parsing HTML.
      #
      # @see https://github.com/lostisland/faraday_middleware/pull/18
      class ParseHtml < FaradayMiddleware::ResponseMiddleware
        dependency 'nokogiri'

        define_parser do |body|
          Nokogiri::HTML(body) unless body.empty?
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
pupa-0.2.4 lib/pupa/processor/middleware/parse_html.rb
pupa-0.2.3 lib/pupa/processor/middleware/parse_html.rb
pupa-0.2.2 lib/pupa/processor/middleware/parse_html.rb
pupa-0.2.1 lib/pupa/processor/middleware/parse_html.rb
pupa-0.2.0 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.11 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.10 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.9 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.8 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.7 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.6 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.5 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.4 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.3 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.2 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.1 lib/pupa/processor/middleware/parse_html.rb
pupa-0.1.0 lib/pupa/processor/middleware/parse_html.rb
pupa-0.0.13 lib/pupa/processor/middleware/parse_html.rb
pupa-0.0.12 lib/pupa/processor/middleware/parse_html.rb
pupa-0.0.11 lib/pupa/processor/middleware/parse_html.rb