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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3aa932790147998f5ca9123d0df78e7a379e2e38
4
- data.tar.gz: 0d530dd7ce3dc2983dff5e8a665800b23fd6d7c9
3
+ metadata.gz: f6b9ba7b50186ab1b049701e1f9cfd8e0dc3bf21
4
+ data.tar.gz: 203d87b1253351689498679ed5252952d7f3ad18
5
5
  SHA512:
6
- metadata.gz: 16d475bd25f798ba21a9808503f42ed4f9880718263e14be84c70faf66a2ea2272085a5d4db4d9af2856a3a777464fbf6899d7a9ae5e55aebdc6536720eb4dbc
7
- data.tar.gz: 55668b80b37be88783ae7795eb378bc008b6b8b8d34adb6e882d8ce54d98647003cb8f45da0777d10f72c4136e13319546e80d25d8d22dffd6c263c419ea2609
6
+ metadata.gz: 4582a738b78d4b0bc69966de6559ab2e1c8ad547603c915589db407c4e0ad0275d9e250e291e9696db52682d219102afe00631776bd1edb05e1e50be3de7779b
7
+ data.tar.gz: 3b9752a404dddddb1f47039801046f4f879dd709bf11c8192e415bc8ca9a19ad8da25ac27bcd3c641060956f363bea2ed0711e6300375838a8735acb54b2e5f6
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Pincers
2
- VERSION = "0.7.11"
2
+ VERSION = "0.7.12"
3
3
  end
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.11
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-04-19 00:00:00.000000000 Z
11
+ date: 2016-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri