Skip to content

Commit

Permalink
Merge branch 'master' into grosser/args
Browse files Browse the repository at this point in the history
  • Loading branch information
olleolleolle committed Dec 7, 2020
2 parents 2143bb2 + e111db3 commit 2445a3a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 9 additions & 11 deletions lib/faraday/adapter/em_http.rb
Expand Up @@ -93,17 +93,15 @@ def request_options(env)
dependency do
require 'em-http'

if Faraday::Adapter::EMHttp.loaded?
begin
require 'openssl'
rescue LoadError
warn 'Warning: no such file to load -- openssl. ' \
'Make sure it is installed if you want HTTPS support'
else
require 'em-http/version'
if EventMachine::HttpRequest::VERSION < '1.1.6'
require 'faraday/adapter/em_http_ssl_patch'
end
begin
require 'openssl'
rescue LoadError
warn 'Warning: no such file to load -- openssl. ' \
'Make sure it is installed if you want HTTPS support'
else
require 'em-http/version'
if EventMachine::HttpRequest::VERSION < '1.1.6'
require 'faraday/adapter/em_http_ssl_patch'
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday/dependency_loader.rb
Expand Up @@ -13,7 +13,7 @@ def dependency(lib = nil)
self.load_error = e
end

def new(*args, **kwargs)
def new(*)
unless loaded?
raise "missing dependency for #{self}: #{load_error.message}"
end
Expand Down

0 comments on commit 2445a3a

Please sign in to comment.