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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/colissimo_label/generate_label.rb +8 -3
- data/lib/colissimo_label/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8f8a20a327418dfe312470af34a34eb7d696ff7b1b70b09730551dae5d7c196
|
4
|
+
data.tar.gz: e5f1f5ddc8e585af429daaad47127140e1a6ba84fc1d17993c1149ddbe669580
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd7786f6db79f6c3ab98e628c24c9b5f58158b40b3340a3681cb059a4e61a0876fcab0f0f7761bec40a088a3c684e07a7f637a67fc8879a64f8f459e2921872a
|
7
|
+
data.tar.gz: 11f967dc681137202a478d1692bca789f9fca43e9b7d201f65cf240adbeaaaf68514473c8aceebbded2d3cbc99d669a0b9b89f55456dafb11540842b4f80f4b2
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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
|
-
|
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
|
-
|
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
|
|
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.
|
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-
|
11
|
+
date: 2019-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|