garnet_client 0.1.8 → 0.1.9

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: a35f6708cdb324815061bae7cafb4df432ec632e
4
- data.tar.gz: 299f261bc53e734f9356aa08c95a5ea1bb2e69a6
3
+ metadata.gz: 1c9df343c1bfe994acf39bc010cab0162beace91
4
+ data.tar.gz: 00062db3afb701dd4e4a0bed47eb59ad0e071393
5
5
  SHA512:
6
- metadata.gz: 0d222cb1e668f81080fb311ed36dc33bd04026c138e1464eba12b3c8feb6653fbe77a5b53c24213f18cc48694cdd43d296a2fe2590453c679d5fff1e14b6a32d
7
- data.tar.gz: 3b3a7a9306728f03877f7d1f32bd12372e406d4c0b4cfce1d61fecd0332e38393d575ef0eb9581b6689ca403e05ee93c18fb4961db18d9c6785c106856e7b968
6
+ metadata.gz: cb44e7159d30251623e5060007e23f36d943ddb0d130c6e2cd8a010a69a1fc7ecebd35dd5e4367119c9e7eb2cce65288ae382ef6e5299f376e9d0da38bc13980
7
+ data.tar.gz: d3d0986042157d347c4cf2a715ce7817d8446a8aac1ce9ac9bf9493bdb3e5f45f69e3f0ea00935c53e5481f44439f9f0ff60c3031b63650c7cf87016b946ec50
@@ -15,9 +15,12 @@ module GarnetClient
15
15
  resp_err = nil
16
16
 
17
17
  begin
18
- response = HTTParty.post(api_url, :body =>JSON.dump(query_params), :headers => headers, timeout: 10)
18
+ response = HTTParty.post(api_url, :body =>JSON.dump(query_params), :headers => headers, timeout: 20)
19
19
  html_result = response.body
20
+ html_content = html_result
21
+ msg = JSON.parse(html_result)
20
22
  rescue JSON::ParserError => e
23
+ msg = JSON.parse(DEFAULT_ERR_MSG)
21
24
  resp_err = e
22
25
  end
23
26
 
@@ -28,15 +31,9 @@ module GarnetClient
28
31
  logger.info("URL:#{api_url.to_s}")
29
32
  logger.info("PARAMS:#{query_params.to_s}")
30
33
  logger.info("RESPONSE:#{html_result.force_encoding('UTF-8')}")
31
- logger.info("RESPONSE_ERR:#{resp_err}")
34
+ logger.info("RESPONSE_ERR:#{resp_err.message},#{resp_err.backtrace.inspect}")
32
35
  end
33
36
 
34
- begin
35
- msg = JSON.parse(html_result)
36
- rescue JSON::ParserError => e
37
- html_content = html_result
38
- msg = JSON.parse(DEFAULT_ERR_MSG)
39
- end
40
37
  return msg, html_content
41
38
  end
42
39
 
@@ -48,9 +45,12 @@ module GarnetClient
48
45
  resp_err = nil
49
46
 
50
47
  begin
51
- response = HTTParty.get(api_url, :headers => headers, timeout: 10)
48
+ response = HTTParty.get(api_url, :headers => headers, timeout: 20)
52
49
  html_result = response.body
50
+ html_content = html_result
51
+ msg = JSON.parse(html_result)
53
52
  rescue JSON::ParserError => e
53
+ msg = JSON.parse(DEFAULT_ERR_MSG)
54
54
  resp_err = e
55
55
  end
56
56
 
@@ -60,15 +60,9 @@ module GarnetClient
60
60
  logger.info('--------------GarnetClient DEBUG--------------')
61
61
  logger.info("URL:#{api_url.to_s}")
62
62
  logger.info("RESPONSE:#{html_result.force_encoding('UTF-8')}")
63
- logger.info("RESPONSE_ERR:#{resp_err}")
63
+ logger.info("RESPONSE_ERR:#{resp_err.message},#{resp_err.backtrace.inspect}")
64
64
  end
65
65
 
66
- begin
67
- msg = JSON.parse(html_result)
68
- rescue JSON::ParserError => e
69
- html_content = html_result
70
- msg = JSON.parse(DEFAULT_ERR_MSG)
71
- end
72
66
  return msg, html_content
73
67
  end
74
68
  end
@@ -1,3 +1,3 @@
1
1
  module GarnetClient
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garnet_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - tarzansos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-08 00:00:00.000000000 Z
11
+ date: 2018-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty