Sha256: 425d79669554015f1011e4be6b099a2353a640b8f3221611dc554e8439095c23

Contents?: true

Size: 856 Bytes

Versions: 15

Compression:

Stored size: 856 Bytes

Contents

# if the webdrivers gem is included, patch it so that it can make HTTP requests to download
# drivers when necessary.
#
# based on the v3.9.4 release of webdrivers gem
# https://github.com/titusfortner/webdrivers/blob/v3.9.4/lib/webdrivers/network.rb#L47-L54
#
# and the v3.5.1 release of webmock gem
# https://github.com/bblimke/webmock/blob/v3.5.1/lib/webmock/http_lib_adapters/net_http.rb#L12
webdrivers = begin
  require "webdrivers"
  true
rescue LoadError
  false
end

if webdrivers
  class Webdrivers::Network
    class << self
      def http
        client = WebMock::HttpLibAdapters::NetHttpAdapter::OriginalNetHTTP
        if using_proxy
          client.Proxy(Webdrivers.proxy_addr, Webdrivers.proxy_port,
                       Webdrivers.proxy_user, Webdrivers.proxy_pass)
        else
          client
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
webvalve-2.0.3 lib/webvalve/monkey_patches.rb
webvalve-2.0.2 lib/webvalve/monkey_patches.rb
webvalve-2.0.0 lib/webvalve/monkey_patches.rb
webvalve-1.3.1 lib/webvalve/monkey_patches.rb
webvalve-1.3.0 lib/webvalve/monkey_patches.rb
webvalve-1.2.0 lib/webvalve/monkey_patches.rb
webvalve-1.1.0 lib/webvalve/monkey_patches.rb
webvalve-1.0.2 lib/webvalve/monkey_patches.rb
webvalve-1.0.1 lib/webvalve/monkey_patches.rb
webvalve-1.0.0 lib/webvalve/monkey_patches.rb
webvalve-0.12.0 lib/webvalve/monkey_patches.rb
webvalve-0.11.0 lib/webvalve/monkey_patches.rb
webvalve-0.10.0 lib/webvalve/monkey_patches.rb
webvalve-0.9.10 lib/webvalve/monkey_patches.rb
webvalve-0.9.9 lib/webvalve/monkey_patches.rb