colissimo_label 0.6.0 → 0.7.0

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
  SHA256:
3
- metadata.gz: 2d6b924ca4a6fb909876e4253cc0a9c53ff6949bf57fb1ac0805dbd9d12851a5
4
- data.tar.gz: 59ae5d6b1c9abbddfdf19e013b66f1d41d9de678aef0eb8cd8bfb5420fe3f898
3
+ metadata.gz: f8f8a20a327418dfe312470af34a34eb7d696ff7b1b70b09730551dae5d7c196
4
+ data.tar.gz: e5f1f5ddc8e585af429daaad47127140e1a6ba84fc1d17993c1149ddbe669580
5
5
  SHA512:
6
- metadata.gz: e853256b7fcc1012e3989007e59f9710a50748821e51cb68f235de19857ee9128b6e624c6498d0172cda329a233d961188cd8e7b5d27e5ed5f86f7bcfc1c3628
7
- data.tar.gz: 56a9a8c82d4120bd50d859c2dcb0ff523500186ce0baabeb1383b8a578f825a5379136367fc3d237e1ce71b948e028de86b7e075fc60ec707a519f0325bc1e0e
6
+ metadata.gz: bd7786f6db79f6c3ab98e628c24c9b5f58158b40b3340a3681cb059a4e61a0876fcab0f0f7761bec40a088a3c684e07a7f637a67fc8879a64f8f459e2921872a
7
+ data.tar.gz: 11f967dc681137202a478d1692bca789f9fca43e9b7d201f65cf240adbeaaaf68514473c8aceebbded2d3cbc99d669a0b9b89f55456dafb11540842b4f80f4b2
@@ -1,3 +1,7 @@
1
+ ## 0.7.0
2
+
3
+ - Ensure message response is present
4
+
1
5
  ## 0.6.0
2
6
 
3
7
  - Update for Rails 6
@@ -46,12 +46,17 @@ class ColissimoLabel::GenerateLabel
46
46
  end
47
47
 
48
48
  if status == 400
49
- error_message = response.body.to_s.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').scan(/"messageContent":"(.*?)"/).last.first
49
+ error_message = response.body.to_s.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').scan(/"messageContent":"(.*?)"/).last&.first
50
50
  raise StandardError, error_message
51
51
  else
52
- parcel_number = response.body.to_s.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').scan(/"parcelNumber":"(.*?)",/).last.first
52
+ if (response_message = response.body.to_s.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').scan(/"parcelNumber":"(.*?)",/).last)
53
+ parcel_number = response_message.first
53
54
 
54
- return parcel_number
55
+ return parcel_number
56
+ else
57
+ error_message = response.body.to_s.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').scan(/"messageContent":"(.*?)"/).last&.first
58
+ raise StandardError, error_message
59
+ end
55
60
  end
56
61
  end
57
62
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ColissimoLabel
4
- VERSION = '0.6.0'.freeze
4
+ VERSION = '0.7.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colissimo_label
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FloXcoder
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-18 00:00:00.000000000 Z
11
+ date: 2019-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack