pincers 0.7.11 → 0.7.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pincers/http/client.rb +5 -0
- data/lib/pincers/http/session.rb +10 -1
- data/lib/pincers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6b9ba7b50186ab1b049701e1f9cfd8e0dc3bf21
|
4
|
+
data.tar.gz: 203d87b1253351689498679ed5252952d7f3ad18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4582a738b78d4b0bc69966de6559ab2e1c8ad547603c915589db407c4e0ad0275d9e250e291e9696db52682d219102afe00631776bd1edb05e1e50be3de7779b
|
7
|
+
data.tar.gz: 3b9752a404dddddb1f47039801046f4f879dd709bf11c8192e415bc8ca9a19ad8da25ac27bcd3c641060956f363bea2ed0711e6300375838a8735acb54b2e5f6
|
data/lib/pincers/http/client.rb
CHANGED
@@ -17,6 +17,11 @@ module Pincers::Http
|
|
17
17
|
session.headers.merge! _options[:headers] if _options.key? :headers
|
18
18
|
session.redirect_limit = _options[:redirect_limit] if _options.key? :redirect_limit
|
19
19
|
|
20
|
+
if _options.key? :ssl_cert
|
21
|
+
session.ssl_cert = _options[:ssl_cert]
|
22
|
+
session.ssl_key = _options[:ssl_key]
|
23
|
+
end
|
24
|
+
|
20
25
|
client = self.new session, _options[:document]
|
21
26
|
client.freeze if _options[:freeze]
|
22
27
|
client
|
data/lib/pincers/http/session.rb
CHANGED
@@ -11,7 +11,8 @@ module Pincers::Http
|
|
11
11
|
}
|
12
12
|
|
13
13
|
attr_reader :cookie_jar, :headers
|
14
|
-
attr_accessor :proxy_addr, :proxy_port, :proxy_user, :proxy_password, :redirect_limit
|
14
|
+
attr_accessor :proxy_addr, :proxy_port, :proxy_user, :proxy_password, :redirect_limit,
|
15
|
+
:ssl_cert, :ssl_key
|
15
16
|
|
16
17
|
def initialize(_other = nil)
|
17
18
|
if _other
|
@@ -20,6 +21,8 @@ module Pincers::Http
|
|
20
21
|
@proxy_addr = _other.proxy_addr
|
21
22
|
@proxy_port = _other.proxy_port
|
22
23
|
@redirect_limit = _other.redirect_limit
|
24
|
+
@ssl_cert = _other.ssl_cert
|
25
|
+
@ssl_key = _other.ssl_key
|
23
26
|
else
|
24
27
|
@headers = DEFAULT_HEADERS
|
25
28
|
@cookie_jar = CookieJar.new
|
@@ -102,6 +105,12 @@ module Pincers::Http
|
|
102
105
|
)
|
103
106
|
|
104
107
|
conn.use_ssl = true if _uri.scheme == 'https'
|
108
|
+
|
109
|
+
if ssl_cert
|
110
|
+
conn.cert = ssl_cert
|
111
|
+
conn.key = ssl_key
|
112
|
+
end
|
113
|
+
|
105
114
|
conn.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
106
115
|
conn
|
107
116
|
end
|
data/lib/pincers/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pincers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ignacio Baixas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|