ezapi_client 1.0.2 → 1.0.3

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
  SHA256:
3
- metadata.gz: 1f32ece67a744e2ef03c3aa70f5c1b89d5afed43fcc1de3925bc9bedf978490f
4
- data.tar.gz: 768e1635e03a099948489000ed3378f7984f9ee618ab2076e2728ebecb00f9e8
3
+ metadata.gz: 2b722d7d9408b1bd107cb6e9030377697bcc10dd60f3f13629f596b0423da53a
4
+ data.tar.gz: bf780364b5b1ed143f10236ac85c53471f1b7bd8b991d32b46a5709274b9a655
5
5
  SHA512:
6
- metadata.gz: 88efcc6dea30c17827eb5a05413b2c37ed3fa511dc024adbae1199b874c89077e9b300efef05fa627b3606d39ac0e43e88f1ae88a93a8f088127c8a912b8aca7
7
- data.tar.gz: 4608823cbc5cae35aa88fd0b81110063c69b9249252fd755be006fd5b69e122c996f3ca49ea6f407cd965fa145427cc8f0a7d0bacfcc1be7e5ad611b1d0082ff
6
+ metadata.gz: 8ef972672fe065716c03140d8db738b51294fc0335e52548cd497415e7f65248c77c558a1aa79f6daafae50a30567ebda67f15f241da87634d0d830b164a8037
7
+ data.tar.gz: 8c89dc1ce80a906688a4ec4b1172869875003ae57d9f06a217dfb87ca062d584f873124d24fc16d5b5bab8349169fb50e5769930be57f4d9a3fd33365b54c12b
@@ -2,6 +2,11 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [1.0.3] - 2019-05-27
6
+ ### Fixed
7
+ - EZAPI server couldn't parse escaped JSON; escape values instead of whole JSON instead
8
+ - Response `#success` is false if response is not valid JSON
9
+
5
10
  ## [1.0.2] - 2019-05-14
6
11
  ### Fixed
7
12
  - Shell command to java blows up when sender/recipient name or address includes `'`
@@ -14,11 +14,14 @@ module EZAPIClient
14
14
  private
15
15
 
16
16
  def default_success
17
+ return false if response_body.nil?
17
18
  response_body[:success]
18
19
  end
19
20
 
20
21
  def default_response_body
21
22
  JSON.parse(raw_response.body)
23
+ rescue JSON::ParserError
24
+ nil
22
25
  end
23
26
 
24
27
  def default_code
@@ -36,13 +36,13 @@ module EZAPIClient
36
36
  username,
37
37
  password,
38
38
  reference_no,
39
- "'#{Shellwords.escape(json)}'",
39
+ "'#{json}'",
40
40
  ].join(" ")
41
41
  end
42
42
 
43
43
  def default_json
44
44
  message.each_with_object({}) do |(key, value), hash|
45
- hash[key.to_s.camelcase(:lower)] = value
45
+ hash[key.to_s.camelcase(:lower)] = Shellwords.escape(value)
46
46
  end.to_json
47
47
  end
48
48
 
@@ -1,3 +1,3 @@
1
1
  module EZAPIClient
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ezapi_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-14 00:00:00.000000000 Z
11
+ date: 2019-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport