pincers 0.7.8 → 0.7.9
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 +1 -0
- data/lib/pincers/http/session.rb +18 -2
- 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: 7800842ba137af69fd78dd8480ed2a179e15230c
|
4
|
+
data.tar.gz: bbc37cecae8ce359fb2c3624a2c740323c108328
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9de52857c3280978860ab39012a2d4b5f2dae5a106451f5c1f36de7cfeb1870fffad7b95e2e3d0b52c9b5fa983e09e06f1d9a0641365301cc2047f9dd429e089
|
7
|
+
data.tar.gz: f3ff2d63ede9741e105fe1aefbd63e20a01108a3dcd31034e2916d5bbc08517e6b65a9e8351d2d07ed546cda6316a6be7a366dbb5263b07c3146beb4152a712a
|
data/lib/pincers/http/client.rb
CHANGED
@@ -13,6 +13,7 @@ module Pincers::Http
|
|
13
13
|
def self.build_from_options(_options = {})
|
14
14
|
session = Session.new
|
15
15
|
session.proxy = _options[:proxy] if _options.key? :proxy
|
16
|
+
session.proxy_auth = _options[:proxy_auth] if _options.key? :proxy_auth
|
16
17
|
session.headers.merge! _options[:headers] if _options.key? :headers
|
17
18
|
session.redirect_limit = _options[:redirect_limit] if _options.key? :redirect_limit
|
18
19
|
|
data/lib/pincers/http/session.rb
CHANGED
@@ -11,7 +11,7 @@ module Pincers::Http
|
|
11
11
|
}
|
12
12
|
|
13
13
|
attr_reader :cookie_jar, :headers
|
14
|
-
attr_accessor :proxy_addr, :proxy_port, :redirect_limit
|
14
|
+
attr_accessor :proxy_addr, :proxy_port, :proxy_user, :proxy_password, :redirect_limit
|
15
15
|
|
16
16
|
def initialize(_other = nil)
|
17
17
|
if _other
|
@@ -35,6 +35,14 @@ module Pincers::Http
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
def proxy_auth=(_value)
|
39
|
+
if _value
|
40
|
+
@proxy_user, @proxy_password = _value.split ':'
|
41
|
+
else
|
42
|
+
@proxy_user, @proxy_password = [nil, nil]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
38
46
|
def clone
|
39
47
|
self.class.new self
|
40
48
|
end
|
@@ -84,7 +92,15 @@ module Pincers::Http
|
|
84
92
|
end
|
85
93
|
|
86
94
|
def connect(_uri)
|
87
|
-
conn = Net::HTTP.new
|
95
|
+
conn = Net::HTTP.new(
|
96
|
+
_uri.host,
|
97
|
+
_uri.port || 80,
|
98
|
+
proxy_addr,
|
99
|
+
proxy_port,
|
100
|
+
proxy_user,
|
101
|
+
proxy_password
|
102
|
+
)
|
103
|
+
|
88
104
|
conn.use_ssl = true if _uri.scheme == 'https'
|
89
105
|
conn.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
90
106
|
conn
|
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.9
|
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-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|