Sha256: 0d3a3f9f0b0ad3318863c9c98ddb28cdd1bd1ef7aad032dfa0bcae7d009dcd65

Contents?: true

Size: 398 Bytes

Versions: 8

Compression:

Stored size: 398 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 { |body|
          Nokogiri::HTML(body) unless body.empty?
        }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pupa-0.0.8 lib/pupa/processor/middleware/parse_html.rb
pupa-0.0.7 lib/pupa/processor/middleware/parse_html.rb
pupa-0.0.6 lib/pupa/processor/middleware/parse_html.rb
pupa-0.0.5 lib/pupa/processor/middleware/parse_html.rb
pupa-0.0.4 lib/pupa/processor/middleware/parse_html.rb
pupa-0.0.3 lib/pupa/processor/middleware/parse_html.rb
pupa-0.0.2 lib/pupa/processor/middleware/parse_html.rb
pupa-0.0.1 lib/pupa/processor/middleware/parse_html.rb