gentle 0.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gentle/error_message.rb +14 -4
- data/lib/gentle/version.rb +1 -1
- data/spec/unit/error_message_spec.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36d0dad4c3c9a7e45655dfacd6e71bfff4c0f1d1
|
4
|
+
data.tar.gz: b546195997272fd408a86577a42fa1d20e7a5dc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78b86e3089d1c145a538b8a3610ddaf6e2a4b79d1e0f75972980bcef1b3f383b59927c16efccf29e9c281650c27d22775d063f8b129f35f0c18a4dbdc637d436
|
7
|
+
data.tar.gz: 0d43656434b811122d9a62a3d4ccf820fa450966974976b07df66bffa4c78e2f44bcde53221ae9853278153b9ea84589c4026c94fb338e8a4aa90c859dc09675
|
data/lib/gentle/error_message.rb
CHANGED
@@ -10,10 +10,20 @@ module Gentle
|
|
10
10
|
@xml.serialize(encoding: "UTF-8")
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
def identifier
|
14
|
+
filename[2]
|
15
|
+
end
|
16
|
+
alias_method :shipment_number, :identifier
|
17
|
+
|
18
|
+
def object_type
|
19
|
+
filename[1] unless filename.nil?
|
20
|
+
end
|
21
|
+
|
22
|
+
def result_description
|
23
|
+
@result_description ||= @xml.css("ErrorMessage").first["ResultDescription"]
|
24
|
+
end
|
25
|
+
def filename
|
26
|
+
@filename ||= result_description.split('_') unless result_description.nil?
|
17
27
|
end
|
18
28
|
end
|
19
29
|
end
|
data/lib/gentle/version.rb
CHANGED
@@ -14,8 +14,12 @@ module Gentle
|
|
14
14
|
assert_equal normalize(@xml_content), normalize(@message.to_xml)
|
15
15
|
end
|
16
16
|
|
17
|
-
it "extracts the
|
18
|
-
assert_equal "H123456789", @message.
|
17
|
+
it "extracts the identifier from the error message" do
|
18
|
+
assert_equal "H123456789", @message.identifier
|
19
|
+
end
|
20
|
+
|
21
|
+
it "extracts the object type from the error message" do
|
22
|
+
assert_equal "ShipmentOrder", @message.object_type
|
19
23
|
end
|
20
24
|
|
21
25
|
it "returns nil for shipment number if it cannot find it" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gentle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DynamoMTL
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|