httplog 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34ea5d5a3d79f010bc367c72fb3296c489907adf
4
- data.tar.gz: e5972f20db489dd25c0d4949a9f1ea10921112f5
3
+ metadata.gz: 62e9129265a40691ce4b016c6883c68d1d3962bb
4
+ data.tar.gz: 33d81b489ec890a844ead102eb3b475a4e51fdbe
5
5
  SHA512:
6
- metadata.gz: ae5751a11e8628998d96f3ea5327f1611ce80ec740de63006995cdcc9c79ded044bc8db717f8d51679a6dfbdfaf3c96fe9c335d55fa35ea472735a9c27928abb
7
- data.tar.gz: 0b81643d6f33074cbb5b8e4041310f77c7e349e037d8167e1c3ae77f0a935c33924ca9c163ec8bba18f7637c70ff66cc3f462de2c5011b8a13d96e7b502d786c
6
+ metadata.gz: f418fcf451cc347381b112ba5433cd1f542e0fe402c137801c6eab9385959666b13e051b62784acf545d767b4a14e0d8994198d53b083e8101d898bcea5322aa
7
+ data.tar.gz: a5061bd6083a73d61129fff9adea0070740490cbfcc231e40e989d295f8bee28f4d805626749eec9a783bd3c1d0aad02de207f3e6997d43baa2523202eeba323
@@ -36,11 +36,24 @@ if defined?(::HTTPClient)
36
36
 
37
37
  class Session
38
38
  alias_method :orig_create_socket, :create_socket
39
- def create_socket(site)
40
- if HttpLog.url_approved?("#{site.host}:#{site.port}")
41
- HttpLog.log_connection(site.host, site.port)
39
+
40
+ # up to version 2.6, the method signature is `create_socket(site)`; after that,
41
+ # it's `create_socket(hort, port)`
42
+ if instance_method(:create_socket).arity == 1
43
+ def create_socket(site)
44
+ if HttpLog.url_approved?("#{site.host}:#{site.port}")
45
+ HttpLog.log_connection(site.host, site.port)
46
+ end
47
+ orig_create_socket(site)
48
+ end
49
+
50
+ else
51
+ def create_socket(host, port)
52
+ if HttpLog.url_approved?("#{host}:#{port}")
53
+ HttpLog.log_connection(host, port)
54
+ end
55
+ orig_create_socket(host,port)
42
56
  end
43
- orig_create_socket(site)
44
57
  end
45
58
  end
46
59
  end
@@ -1,4 +1,4 @@
1
1
  module HttpLog
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httplog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thilo Rusche
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-06 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec