rsolr-client-cert 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -36,4 +36,5 @@ options.
36
36
 
37
37
  ## Version History
38
38
 
39
- - <b>0.5.0</b> Initial release
39
+ - <b>0.5.0</b> Initial release
40
+ - <b>0.5.1</b> Add additional HTTP method support, as well as all RSolr request_context parameters
@@ -13,20 +13,29 @@ module RSolr
13
13
  end
14
14
 
15
15
  def execute client, request_context
16
- resource = RestClient::Resource.new(
17
- request_context[:uri].to_s,
18
- :ssl_client_cert => ssl_client_cert,
19
- :ssl_client_key => ssl_client_key
20
- )
21
- result = {}
22
- resource.send(request_context[:method]) { |response, request, result, &block|
23
- result = {
24
- :status => response.net_http_res.code.to_i,
25
- :headers => response.net_http_res.to_hash,
26
- :body => response.net_http_res.body
16
+ old_proxy = RestClient.proxy
17
+ begin
18
+ RestClient.proxy = request_context[:proxy]
19
+ resource = RestClient::Resource.new(
20
+ request_context[:uri].to_s,
21
+ :open_timeout => request_context[:open_timeout],
22
+ :timeout => request_context[:read_timeout],
23
+ :ssl_client_cert => ssl_client_cert,
24
+ :ssl_client_key => ssl_client_key
25
+ )
26
+ result = {}
27
+ signature = [request_context[:method], request_context[:data], request_context[:headers]].compact
28
+ resource.send(*signature) { |response, request, result, &block|
29
+ result = {
30
+ :status => response.net_http_res.code.to_i,
31
+ :headers => response.net_http_res.to_hash,
32
+ :body => response.net_http_res.body
33
+ }
27
34
  }
28
- }
29
- result
35
+ result
36
+ ensure
37
+ RestClient.proxy = old_proxy
38
+ end
30
39
  end
31
40
 
32
41
  protected
@@ -1,5 +1,5 @@
1
1
  module RSolr
2
2
  module ClientCert
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsolr-client-cert
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Klein
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-29 00:00:00 Z
18
+ date: 2012-03-02 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake