peddler 1.4.0 → 1.4.1
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 +4 -4
- data/lib/mws/feeds/client.rb +1 -1
- data/lib/mws/fulfillment_inbound_shipment/client.rb +1 -0
- data/lib/mws/reports/client.rb +1 -1
- data/lib/peddler/errors/builder.rb +14 -2
- data/lib/peddler/version.rb +1 -1
- data/test/unit/mws/test_fulfillment_inbound_shipment_client.rb +30 -4
- 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: cda72505daf1765d33219d8c8f0172a896947438
|
4
|
+
data.tar.gz: eb4e2949c291be4ce67391e77a1c51371dbefef2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a15a7ca00095ff09099eda59af7afcfa7ee9d3bda1dd541767e8981eb5bfc2c86e6552e317af377007417e9905c1e0741dbd0d5c13b3e8e839d2b0d3c1c6ac68
|
7
|
+
data.tar.gz: 6df5642273624a132ee07f7308bfaf577b508140260c73df841976d7a565fcb3e1cb146898af9d16c8e60174f0f64741a9e91c4afba94ac63348eb394c39e3ae
|
data/lib/mws/feeds/client.rb
CHANGED
@@ -104,7 +104,7 @@ module MWS
|
|
104
104
|
# @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionResult.html
|
105
105
|
# @param [Integer, String] feed_submission_id
|
106
106
|
# @return [Peddler::XMLParser] if the report is in XML format
|
107
|
-
# @return [Peddler::
|
107
|
+
# @return [Peddler::FlatFileParser] if the report is a flat file
|
108
108
|
def get_feed_submission_result(feed_submission_id)
|
109
109
|
operation('GetFeedSubmissionResult')
|
110
110
|
.add('FeedSubmissionId' => feed_submission_id)
|
data/lib/mws/reports/client.rb
CHANGED
@@ -147,7 +147,7 @@ module MWS
|
|
147
147
|
# @see http://docs.developer.amazonservices.com/en_US/reports/Reports_GetReport.html
|
148
148
|
# @param [String] report_id
|
149
149
|
# @return [Peddler::XMLParser] if report is in XML format
|
150
|
-
# @return [Peddler::
|
150
|
+
# @return [Peddler::FlatFileParser] if report is a flat file
|
151
151
|
def get_report(report_id, &blk)
|
152
152
|
operation('GetReport')
|
153
153
|
.add('ReportId' => report_id)
|
@@ -11,9 +11,21 @@ module Peddler
|
|
11
11
|
instance.build(name)
|
12
12
|
end
|
13
13
|
|
14
|
+
def initialize
|
15
|
+
@mutex = Mutex.new
|
16
|
+
end
|
17
|
+
|
14
18
|
def build(name)
|
15
|
-
|
16
|
-
|
19
|
+
with_mutex do
|
20
|
+
return Errors.const_get(name) if Errors.const_defined?(name)
|
21
|
+
Errors.const_set(name, Class.new(Error))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def with_mutex
|
28
|
+
@mutex.synchronize { yield }
|
17
29
|
end
|
18
30
|
end
|
19
31
|
end
|
data/lib/peddler/version.rb
CHANGED
@@ -50,12 +50,12 @@ class TestMWSFulfillmentInboundShipmentClient < MiniTest::Test
|
|
50
50
|
assert_equal operation, @client.operation
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
53
|
+
def test_puts_transport_content_with_package_list
|
54
54
|
transport_details = {
|
55
|
-
|
56
|
-
|
55
|
+
parcel_data: {
|
56
|
+
package_list: [
|
57
57
|
{
|
58
|
-
|
58
|
+
tracking_id: '123'
|
59
59
|
}
|
60
60
|
]
|
61
61
|
}
|
@@ -76,6 +76,32 @@ class TestMWSFulfillmentInboundShipmentClient < MiniTest::Test
|
|
76
76
|
assert_equal operation, @client.operation
|
77
77
|
end
|
78
78
|
|
79
|
+
def test_puts_transport_content_with_pallet_list
|
80
|
+
transport_details = {
|
81
|
+
parcel_data: {
|
82
|
+
pallet_list: [
|
83
|
+
{
|
84
|
+
tracking_id: '123'
|
85
|
+
}
|
86
|
+
]
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
operation = {
|
91
|
+
'Action' => 'PutTransportContent',
|
92
|
+
'ShipmentId' => '1',
|
93
|
+
'IsPartnered' => true,
|
94
|
+
'ShipmentType' => 'Foo',
|
95
|
+
'TransportDetails.ParcelData.PalletList.member.1.TrackingId' => '123'
|
96
|
+
}
|
97
|
+
|
98
|
+
@client.stub(:run, nil) do
|
99
|
+
@client.put_transport_content('1', true, 'Foo', transport_details)
|
100
|
+
end
|
101
|
+
|
102
|
+
assert_equal operation, @client.operation
|
103
|
+
end
|
104
|
+
|
79
105
|
def test_estimates_transport_request
|
80
106
|
operation = {
|
81
107
|
'Action' => 'EstimateTransportRequest',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peddler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hakan Ensari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|