network-client 1.0.7 → 1.0.8

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: 104f2b9b6881d78ca701ef20d479ab9bccbda5cb
4
- data.tar.gz: cf2c922f4e190608a21cc34e6aeac34965992e45
3
+ metadata.gz: 2948c33239606721a0bab258f94eb7ef32c42441
4
+ data.tar.gz: 897d29f3df3617533a1279843b7a113865c337a1
5
5
  SHA512:
6
- metadata.gz: bcbc6408931008818e5fcb8dca414119bc1679b9329a4413d8447c008b2e0d01839e57cb3092441b46e93c897c2b4eed3cb555ee0d893c87d7d51d8ab3d62dc3
7
- data.tar.gz: b60c9f293435e1ea7922dd00d969da17e8cc87ee5f1fb1dd6dba14dff8fa9d3ff80aeecfaf8eadcde1debcfc9d9db68a2a9572bc6b6f80df5bdef5bc2f68e211
6
+ metadata.gz: 7a646e593e940cf06c3b96e232238dc574f7baf75ba4c6f1a668d25c2d169626ab91211ba086eb615cabac64ee9934fb89cd17f2ee93c9bf133dbb12a4d2a5a6
7
+ data.tar.gz: 89d53050f65e8a84e7fad544b09bf50677e6218c4dc3288b12fca5a0ad60342ec3792ba230578ec01545902572f56347868c38f3546562b48d911b989f605bc1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- network-client (1.0.5)
4
+ network-client (1.0.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -47,6 +47,14 @@ module NetworkClient
47
47
  request_json :delete, path, params, headers
48
48
  end
49
49
 
50
+ def post_form(path, params = {}, headers = {})
51
+ raise NotImplementedError
52
+ end
53
+
54
+ def put_form(path, params = {}, headers = {})
55
+ raise NotImplementedError
56
+ end
57
+
50
58
  def set_logger
51
59
  @logger = if defined?(Rails)
52
60
  Rails.logger
@@ -96,7 +104,7 @@ module NetworkClient
96
104
  request = HTTP_VERBS[http_method].new(full_path, headers)
97
105
  else
98
106
  request = HTTP_VERBS[http_method].new(path, headers)
99
- request.set_form_data(params)
107
+ request.body = params.to_s
100
108
  end
101
109
 
102
110
  response = http_request(request)
@@ -104,7 +112,7 @@ module NetworkClient
104
112
  when Net::HTTPSuccess
105
113
  true
106
114
  else
107
- @logger.error "endpoint responded with a non-success #{code} code."
115
+ @logger.error "endpoint responded with a non-success #{response.code} code."
108
116
  end
109
117
 
110
118
  response
@@ -114,7 +122,7 @@ module NetworkClient
114
122
  begin
115
123
  tries_count ||= @tries
116
124
  response = @http.request(request)
117
- rescue errors_to_recover_by_retry => error
125
+ rescue *errors_to_recover_by_retry => error
118
126
  @logger.warn(error.message)
119
127
  (tries_count -= 1).zero? ? raise : retry
120
128
  else
@@ -1,3 +1,3 @@
1
1
  module NetworkClient
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: network-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdullah Barrak (abarrak)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-16 00:00:00.000000000 Z
11
+ date: 2017-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler