lib/httpi/adapter/net_http_persistent.rb in httpi-2.4.5 vs lib/httpi/adapter/net_http_persistent.rb in httpi-2.5.0
- old
+ new
@@ -10,11 +10,11 @@
register :net_http_persistent, :deps => %w(net/http/persistent)
private
def create_client
- if is_v3
+ if Gem::Version.new(Net::HTTP::Persistent::VERSION) >= Gem::Version.new('3.0.0')
Net::HTTP::Persistent.new name: thread_key
else
Net::HTTP::Persistent.new thread_key
end
end
@@ -40,13 +40,8 @@
end
def thread_key
@request.url.host.split(/\W/).reject{|p|p == ""}.join('-')
end
-
- def is_v3
- Net::HTTP::Persistent::VERSION.start_with? "3."
- end
-
end
end
end