Skip to content

Commit 3b65ecd

Browse files
committed
Applied comment
1 parent 8fee592 commit 3b65ecd

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/httpi/adapter/net_http_persistent.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class NetHTTPPersistent < NetHTTP
1212
private
1313

1414
def create_client
15-
if version > 2
15+
if Gem::Version.new(Net::HTTP::Persistent::VERSION) >= Gem::Version.new('3.0.0')
1616
Net::HTTP::Persistent.new name: thread_key
1717
else
1818
Net::HTTP::Persistent.new thread_key
@@ -42,11 +42,6 @@ def setup_client
4242
def thread_key
4343
@request.url.host.split(/\W/).reject{|p|p == ""}.join('-')
4444
end
45-
46-
def version
47-
Net::HTTP::Persistent::VERSION.split('.')[0].to_i
48-
end
49-
5045
end
5146
end
5247
end

0 commit comments

Comments
 (0)