Sha256: f558e9cf387c9564b498bb9f4ce488fe54eb3a97cb1f3cd3dfb2ad40d2f7fe5c

Contents?: true

Size: 774 Bytes

Versions: 3

Compression:

Stored size: 774 Bytes

Contents

# frozen_string_literal: true

module Wayfarer
  module Networking
    class Ferrum
      include Strategy

      def renew_on
        [::Ferrum::DeadBrowserError]
      end

      def create
        ::Ferrum::Browser.new(Wayfarer.config.ferrum.options).tap do |browser|
          browser.headers.set(Wayfarer.config.network.http_headers)
        end
      end

      def destroy(instance)
        instance.reset
        instance.quit
      end

      def navigate(instance, url)
        instance.goto(url)
      end

      def live(instance)
        success(url: instance.current_url,
                body: instance.body,
                status_code: instance.network.response.status,
                headers: instance.network.response.headers)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wayfarer-0.4.3 lib/wayfarer/networking/ferrum.rb
wayfarer-0.4.2 lib/wayfarer/networking/ferrum.rb
wayfarer-0.4.1 lib/wayfarer/networking/ferrum.rb