unrest 0.1.1 → 0.1.2.pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/unrest/version.rb +1 -1
- data/lib/unrest.rb +6 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03df397bf654a21b0e343f907de827f82709ea9a
|
4
|
+
data.tar.gz: 1825cf58992793dc86b4039d037d5fd6c50cb033
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27bad0a741658d6c979b824469e95dae089c3c49bf607fcb285ecb14f5dea1b8898fe670e8c4f2005b14717ceab06fc4bc001d70f08517d263d9391c9f8370b8
|
7
|
+
data.tar.gz: aaef532121edd439671b5a31bd918e003f015287fae416672da77bb2a1cbeb8350a349ebd509f846bcad84d698b8037e32d17ed5052f18a4e8c24e340afaf4ab
|
data/lib/unrest/version.rb
CHANGED
data/lib/unrest.rb
CHANGED
@@ -52,12 +52,16 @@ class Unrest
|
|
52
52
|
uri.scheme.casecmp('https') == 0
|
53
53
|
end
|
54
54
|
|
55
|
-
def http_client uri
|
55
|
+
def http_client uri, options={}
|
56
56
|
http_client = Net::HTTP.new uri.host, uri.port
|
57
57
|
|
58
58
|
http_client.use_ssl = ssl?(uri)
|
59
59
|
http_client.open_timeout = configuration.timeout
|
60
60
|
http_client.read_timeout = configuration.timeout
|
61
|
+
|
62
|
+
http_client.key = OpenSSL::PKey::RSA.new(options.fetch(:http_client_key, nil))
|
63
|
+
http_client.cert = OpenSSL::X509::Certificate.new(options.fetch(:http_client_cert, nil))
|
64
|
+
|
61
65
|
http_client.set_debug_output($stdout)
|
62
66
|
|
63
67
|
http_client
|
@@ -82,7 +86,7 @@ class Unrest
|
|
82
86
|
|
83
87
|
http_request.body = http_request_body file, arguments
|
84
88
|
|
85
|
-
http_client(uri).request http_request
|
89
|
+
http_client(uri, options).request http_request
|
86
90
|
rescue Timeout::Error
|
87
91
|
raise Unrest::RequestTimeout
|
88
92
|
rescue Errno::EHOSTUNREACH, Errno::ETIMEDOUT, Errno::ENETUNREACH
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unrest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1
|
4
|
+
version: 0.1.2.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Eksteen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -135,9 +135,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
|
-
- - "
|
138
|
+
- - ">"
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version:
|
140
|
+
version: 1.3.1
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
143
|
rubygems_version: 2.5.1
|