16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/flex/http_clients/loader.rb', line 16
def new_http_client
if Gem::Specification.respond_to?(:find_all_by_name)
case
when Gem::Specification::find_all_by_name('patron').any? then require_patron
when Gem::Specification::find_all_by_name('rest-client').any? then require_rest_client
else Dummy.new
end
else
case
when Gem.available?('patron') then require_patron
when Gem.available?('rest-client') then require_rest_client
else Dummy.new
end
end
end
|