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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a863008615e62441c65cd2fc7c729f2a8d52b279
4
- data.tar.gz: ce3e716c37c0f88215171813a2752d2c8469e4ca
3
+ metadata.gz: 03df397bf654a21b0e343f907de827f82709ea9a
4
+ data.tar.gz: 1825cf58992793dc86b4039d037d5fd6c50cb033
5
5
  SHA512:
6
- metadata.gz: d2a857691424f87d618dd2785ffd9e9892b062bee8d4a4d3b0fb48d920c5700e730d13c28796ad230348f04505e599e221ba5d591464785dc01e9d3897bf6dcc
7
- data.tar.gz: 1a136bbbc6a0929bd9ae584d384ce39424c10457c6c35af916f89f96789bd76393a4d633a4243c3b26f330be8d908ccf9bb7fa4fa33d042469aa52178b062fdc
6
+ metadata.gz: 27bad0a741658d6c979b824469e95dae089c3c49bf607fcb285ecb14f5dea1b8898fe670e8c4f2005b14717ceab06fc4bc001d70f08517d263d9391c9f8370b8
7
+ data.tar.gz: aaef532121edd439671b5a31bd918e003f015287fae416672da77bb2a1cbeb8350a349ebd509f846bcad84d698b8037e32d17ed5052f18a4e8c24e340afaf4ab
@@ -1,3 +1,3 @@
1
1
  class Unrest
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2-1"
3
3
  end
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-10 00:00:00.000000000 Z
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: '0'
140
+ version: 1.3.1
141
141
  requirements: []
142
142
  rubyforge_project:
143
143
  rubygems_version: 2.5.1