peddler 1.6.3 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -16
  3. data/lib/mws.rb +2 -0
  4. data/lib/mws/feeds.rb +2 -0
  5. data/lib/mws/feeds/client.rb +2 -0
  6. data/lib/mws/finances.rb +2 -0
  7. data/lib/mws/finances/client.rb +6 -2
  8. data/lib/mws/fulfillment_inbound_shipment.rb +2 -0
  9. data/lib/mws/fulfillment_inbound_shipment/client.rb +23 -10
  10. data/lib/mws/fulfillment_inventory.rb +2 -0
  11. data/lib/mws/fulfillment_inventory/client.rb +2 -0
  12. data/lib/mws/fulfillment_outbound_shipment.rb +2 -0
  13. data/lib/mws/fulfillment_outbound_shipment/client.rb +21 -5
  14. data/lib/mws/merchant_fulfillment.rb +2 -0
  15. data/lib/mws/merchant_fulfillment/client.rb +4 -1
  16. data/lib/mws/off_amazon_payments.rb +2 -0
  17. data/lib/mws/off_amazon_payments/client.rb +51 -23
  18. data/lib/mws/orders.rb +2 -0
  19. data/lib/mws/orders/client.rb +6 -3
  20. data/lib/mws/products.rb +2 -0
  21. data/lib/mws/products/client.rb +30 -14
  22. data/lib/mws/recommendations.rb +2 -0
  23. data/lib/mws/recommendations/client.rb +6 -2
  24. data/lib/mws/reports.rb +2 -0
  25. data/lib/mws/reports/client.rb +2 -0
  26. data/lib/mws/sellers.rb +2 -0
  27. data/lib/mws/sellers/client.rb +2 -0
  28. data/lib/mws/subscriptions.rb +2 -0
  29. data/lib/mws/subscriptions/client.rb +21 -9
  30. data/lib/peddler.rb +2 -0
  31. data/lib/peddler/client.rb +2 -0
  32. data/lib/peddler/errors/builder.rb +2 -0
  33. data/lib/peddler/errors/error.rb +4 -0
  34. data/lib/peddler/errors/handler.rb +2 -0
  35. data/lib/peddler/errors/parser.rb +2 -0
  36. data/lib/peddler/flat_file_parser.rb +4 -1
  37. data/lib/peddler/headers.rb +2 -0
  38. data/lib/peddler/marketplace.rb +2 -0
  39. data/lib/peddler/operation.rb +2 -0
  40. data/lib/peddler/parser.rb +2 -0
  41. data/lib/peddler/structured_list.rb +2 -0
  42. data/lib/peddler/vcr_matcher.rb +2 -0
  43. data/lib/peddler/version.rb +1 -1
  44. data/lib/peddler/xml_parser.rb +2 -0
  45. data/lib/peddler/xml_response_parser.rb +2 -0
  46. data/test/credentials.rb +23 -0
  47. data/test/helper.rb +2 -0
  48. data/test/integration/test_errors.rb +6 -5
  49. data/test/integration/test_feeds.rb +2 -0
  50. data/test/integration/test_fulfillment_inbound_shipment.rb +2 -0
  51. data/test/integration/test_fulfillment_inventory.rb +2 -0
  52. data/test/integration/test_fulfillment_outbound_shipment.rb +2 -0
  53. data/test/integration/test_merchant_fulfillment.rb +2 -0
  54. data/test/integration/test_multibyte_queries.rb +3 -4
  55. data/test/integration/test_mws_headers.rb +3 -4
  56. data/test/integration/test_off_amazon_payments.rb +2 -0
  57. data/test/integration/test_orders.rb +8 -10
  58. data/test/integration/test_products.rb +2 -0
  59. data/test/integration/test_recommendations.rb +2 -0
  60. data/test/integration/test_reports.rb +2 -0
  61. data/test/integration/test_sellers.rb +2 -0
  62. data/test/integration/test_subscriptions.rb +2 -0
  63. data/test/integration_helper.rb +25 -12
  64. data/test/null_client.rb +2 -0
  65. data/test/recorder.rb +2 -0
  66. data/test/unit/mws/test_feeds_client.rb +2 -0
  67. data/test/unit/mws/test_finances_client.rb +2 -0
  68. data/test/unit/mws/test_fulfillment_inbound_shipment_client.rb +2 -0
  69. data/test/unit/mws/test_fulfillment_inventory_client.rb +2 -0
  70. data/test/unit/mws/test_fulfillment_outbound_shipment_client.rb +7 -2
  71. data/test/unit/mws/test_merchant_fulfillment_client.rb +2 -0
  72. data/test/unit/mws/test_off_amazon_payments_client.rb +2 -0
  73. data/test/unit/mws/test_orders_client.rb +2 -0
  74. data/test/unit/mws/test_products_client.rb +2 -0
  75. data/test/unit/mws/test_recommendations_client.rb +2 -0
  76. data/test/unit/mws/test_reports_client.rb +2 -0
  77. data/test/unit/mws/test_sellers_client.rb +2 -0
  78. data/test/unit/mws/test_subscriptions_client.rb +2 -0
  79. data/test/unit/peddler/errors/test_builder.rb +2 -0
  80. data/test/unit/peddler/errors/test_error.rb +2 -0
  81. data/test/unit/peddler/errors/test_handler.rb +2 -0
  82. data/test/unit/peddler/errors/test_parser.rb +2 -0
  83. data/test/unit/peddler/test_client.rb +6 -2
  84. data/test/unit/peddler/test_flat_file_parser.rb +27 -24
  85. data/test/unit/peddler/test_headers.rb +2 -0
  86. data/test/unit/peddler/test_marketplace.rb +2 -0
  87. data/test/unit/peddler/test_operation.rb +2 -0
  88. data/test/unit/peddler/test_parser.rb +2 -0
  89. data/test/unit/peddler/test_structured_list.rb +2 -0
  90. data/test/unit/peddler/test_vcr_matcher.rb +2 -0
  91. data/test/unit/peddler/test_xml_parser.rb +3 -1
  92. data/test/unit/peddler/test_xml_response_parser.rb +2 -0
  93. data/test/unit/test_mws.rb +2 -0
  94. metadata +58 -58
  95. data/test/mws.yml +0 -36
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mws/orders/client'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'peddler/client'
2
4
 
3
5
  module MWS
@@ -106,9 +108,10 @@ module MWS
106
108
  private
107
109
 
108
110
  def require_start_time!
109
- if operation.values_at('CreatedAfter', 'LastUpdatedAfter').compact.empty?
110
- raise ArgumentError, 'specify created_after or last_updated_after'
111
- end
111
+ return if operation.key?('CreatedAfter')
112
+ return if operation.key?('LastUpdatedAfter')
113
+
114
+ raise ArgumentError, 'specify created_after or last_updated_after'
112
115
  end
113
116
  end
114
117
  end
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mws/products/client'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'peddler/client'
2
4
 
3
5
  module MWS
@@ -13,7 +15,8 @@ module MWS
13
15
  # Lists products and their attributes, based on a search query
14
16
  #
15
17
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_ListMatchingProducts.html
16
- # @overload list_matching_products(query, opts = { marketplace_id: primary_marketplace_id })
18
+ # @overload list_matching_products(query, opts = { marketplace_id:
19
+ # primary_marketplace_id })
17
20
  # @param [String] query
18
21
  # @param [Hash] opts
19
22
  # @option opts [String] :marketplace_id
@@ -30,7 +33,8 @@ module MWS
30
33
  # SellerSKU, UPC, EAN, ISBN, and JAN values
31
34
  #
32
35
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProduct.html
33
- # @overload get_matching_product_for_id(id_type, *ids, opts = { marketplace_id: primary_marketplace_id })
36
+ # @overload get_matching_product_for_id(id_type, *ids, opts = {
37
+ # marketplace_id: primary_marketplace_id })
34
38
  # @param [String] id_type
35
39
  # @param [String] id one or more ids
36
40
  # @param [Hash] opts
@@ -49,7 +53,8 @@ module MWS
49
53
  # Lists products and their attributes, based on a list of ASIN values
50
54
  #
51
55
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProductForId.html
52
- # @overload get_matching_product(*asins, opts = { marketplace_id: primary_marketplace_id })
56
+ # @overload get_matching_product(*asins, opts = { marketplace_id:
57
+ # primary_marketplace_id })
53
58
  # @param [String] asin one or more asins
54
59
  # @param [Hash] opts
55
60
  # @option opts [String] :marketplace_id
@@ -67,7 +72,8 @@ module MWS
67
72
  # Gets the current competitive price of a product, based on Seller SKU
68
73
  #
69
74
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetCompetitivePricingForSKU.html
70
- # @overload get_competitive_pricing_for_sku(*seller_skus, opts = { marketplace_id: primary_marketplace_id })
75
+ # @overload get_competitive_pricing_for_sku(*seller_skus, opts = {
76
+ # marketplace_id: primary_marketplace_id })
71
77
  # @param [String] seller_sku one or more seller_skus
72
78
  # @param [Hash] opts
73
79
  # @option opts [String] :marketplace_id
@@ -85,7 +91,8 @@ module MWS
85
91
  # Gets the current competitive price of a product, identified by its ASIN
86
92
  #
87
93
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetCompetitivePricingForASIN.html
88
- # @overload get_competitive_pricing_for_asin(*asins, opts = { marketplace_id: primary_marketplace_id })
94
+ # @overload get_competitive_pricing_for_asin(*asins, opts = {
95
+ # marketplace_id: primary_marketplace_id })
89
96
  # @param [String] asin one or more asins
90
97
  # @param [Hash] opts
91
98
  # @option opts [String] :marketplace_id
@@ -104,7 +111,8 @@ module MWS
104
111
  # a product, based on Seller SKU
105
112
  #
106
113
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetLowestOfferListingsForSKU.html
107
- # @overload get_lowest_offer_listings_for_sku(*seller_skus, opts = { marketplace_id: primary_marketplace_id })
114
+ # @overload get_lowest_offer_listings_for_sku(*seller_skus, opts = {
115
+ # marketplace_id: primary_marketplace_id })
108
116
  # @param [String] seller_sku one or more seller_skus
109
117
  # @param [Hash] opts
110
118
  # @option opts [String] :marketplace_id
@@ -125,7 +133,8 @@ module MWS
125
133
  # a product, identified by its ASIN
126
134
  #
127
135
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetLowestOfferListingsForASIN.html
128
- # @overload get_lowest_offer_listings_for_asin(*asins, opts = { marketplace_id: primary_marketplace_id })
136
+ # @overload get_lowest_offer_listings_for_asin(*asins, opts = {
137
+ # marketplace_id: primary_marketplace_id })
129
138
  # @param [String] asin one or more asins
130
139
  # @param [Hash] opts
131
140
  # @option opts [String] :marketplace_id
@@ -145,13 +154,15 @@ module MWS
145
154
  # Gets lowest priced offers for a single product, based on SellerSKU
146
155
  #
147
156
  # @see http://docs.developer.amazonservices.com/en_MX/products/Products_GetLowestPricedOffersForSKU.html
148
- # @overload get_lowest_priced_offers_for_sku(seller_sku, item_condition, opts = { marketplace_id: primary_marketplace_id })
157
+ # @overload get_lowest_priced_offers_for_sku(seller_sku, item_condition,
158
+ # opts = { marketplace_id: primary_marketplace_id })
149
159
  # @param [String] seller_sku
150
160
  # @param [String] item_condition
151
161
  # @param [Hash] opts
152
162
  # @option opts [String] :marketplace_id
153
163
  # @return [Peddler::XMLParser]
154
- def get_lowest_priced_offers_for_sku(seller_sku, item_condition, opts = {})
164
+ def get_lowest_priced_offers_for_sku(seller_sku, item_condition,
165
+ opts = {})
155
166
  opts.update(
156
167
  'SellerSKU' => seller_sku,
157
168
  'ItemCondition' => item_condition
@@ -165,7 +176,8 @@ module MWS
165
176
  # Gets lowest priced offers for a single product, based on ASIN
166
177
  #
167
178
  # @see http://docs.developer.amazonservices.com/en_MX/products/Products_GetLowestPricedOffersForASIN.html
168
- # @overload get_lowest_priced_offers_for_asin(asin, item_condition, opts = { marketplace_id: primary_marketplace_id })
179
+ # @overload get_lowest_priced_offers_for_asin(asin, item_condition, opts =
180
+ # { marketplace_id: primary_marketplace_id })
169
181
  # @param [String] asin
170
182
  # @param [String] item_condition
171
183
  # @param [Hash] opts
@@ -200,7 +212,8 @@ module MWS
200
212
  # Seller SKU
201
213
  #
202
214
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetMyPriceForSKU.html
203
- # @overload get_my_price_for_sku(*seller_skus, opts = { marketplace_id: primary_marketplace_id })
215
+ # @overload get_my_price_for_sku(*seller_skus, opts = { marketplace_id:
216
+ # primary_marketplace_id })
204
217
  # @param [String] seller_sku one or more seller_skus
205
218
  # @param [Hash] opts
206
219
  # @option opts [String] :marketplace_id
@@ -220,7 +233,8 @@ module MWS
220
233
  # its ASIN
221
234
  #
222
235
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetMyPriceForASIN.html
223
- # @overload get_my_price_for_asin(*asins, opts = { marketplace_id: primary_marketplace_id })
236
+ # @overload get_my_price_for_asin(*asins, opts = { marketplace_id:
237
+ # primary_marketplace_id })
224
238
  # @param [String] asin one or more asins
225
239
  # @param [Hash] opts
226
240
  # @option opts [String] :marketplace_id
@@ -240,7 +254,8 @@ module MWS
240
254
  # Seller`SKU
241
255
  #
242
256
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetProductCategoriesForSKU.html
243
- # @overload get_product_categories_for_sku(sku, opts = { marketplace_id: primary_marketplace_id })
257
+ # @overload get_product_categories_for_sku(sku, opts = { marketplace_id:
258
+ # primary_marketplace_id })
244
259
  # @param [String] seller_sku
245
260
  # @param [Hash] opts
246
261
  # @option opts [String] :marketplace_id
@@ -255,7 +270,8 @@ module MWS
255
270
  # Gets parent product categories that a product belongs to, based on ASIN
256
271
  #
257
272
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetProductCategoriesForASIN.html
258
- # @overload get_product_categories_for_asin(asin, opts = { marketplace_id: primary_marketplace_id })
273
+ # @overload get_product_categories_for_asin(asin, opts = { marketplace_id:
274
+ # primary_marketplace_id })
259
275
  # @param [String] asin
260
276
  # @param [Hash] opts
261
277
  # @option opts [String] :marketplace_id
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mws/recommendations/client'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'peddler/client'
2
4
 
3
5
  module MWS
@@ -17,7 +19,8 @@ module MWS
17
19
  # @see http://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_GetLastUpdatedTimeForRecommendations.html
18
20
  # @param [String] marketplace_id
19
21
  # @return [Peddler::XMLParser]
20
- def get_last_updated_time_for_recommendations(marketplace_id = primary_marketplace_id)
22
+ def get_last_updated_time_for_recommendations(marketplace_id =
23
+ primary_marketplace_id)
21
24
  operation('GetLastUpdatedTimeForRecommendations')
22
25
  .add('MarketplaceId' => marketplace_id)
23
26
 
@@ -28,7 +31,8 @@ module MWS
28
31
  # categories for a specific marketplace
29
32
  #
30
33
  # @see http://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_ListRecommendations.html
31
- # @overload list_recommendations(opts = { marketplace_id: primary_marketplace_id })
34
+ # @overload list_recommendations(opts = { marketplace_id:
35
+ # primary_marketplace_id })
32
36
  # @param [Hash] opts
33
37
  # @option opts [String] :marketplace_id
34
38
  # @option opts [String] :recommendation_category
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mws/reports/client'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'peddler/client'
2
4
 
3
5
  module MWS
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mws/sellers/client'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'peddler/client'
2
4
 
3
5
  module MWS
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mws/subscriptions/client'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'peddler/client'
2
4
 
3
5
  module MWS
@@ -18,7 +20,8 @@ module MWS
18
20
  # @param [String] sqs_queue_url
19
21
  # @param [String] marketplace_id
20
22
  # @return [Peddler::XMLParser]
21
- def register_destination(sqs_queue_url, marketplace_id = primary_marketplace_id)
23
+ def register_destination(sqs_queue_url,
24
+ marketplace_id = primary_marketplace_id)
22
25
  operation('RegisterDestination')
23
26
  .add('MarketplaceId' => marketplace_id)
24
27
  .add(build_destination(sqs_queue_url))
@@ -32,7 +35,8 @@ module MWS
32
35
  # @param [String] sqs_queue_url
33
36
  # @param [String] marketplace_id
34
37
  # @return [Peddler::XMLParser]
35
- def deregister_destination(sqs_queue_url, marketplace_id = primary_marketplace_id)
38
+ def deregister_destination(sqs_queue_url,
39
+ marketplace_id = primary_marketplace_id)
36
40
  operation('DeregisterDestination')
37
41
  .add('MarketplaceId' => marketplace_id)
38
42
  .add(build_destination(sqs_queue_url))
@@ -58,7 +62,9 @@ module MWS
58
62
  # @param [String] sqs_queue_url
59
63
  # @param [String] marketplace_id
60
64
  # @return [Peddler::XMLParser]
61
- def send_test_notification_to_destination(sqs_queue_url, marketplace_id = primary_marketplace_id)
65
+ def send_test_notification_to_destination(sqs_queue_url,
66
+ marketplace_id =
67
+ primary_marketplace_id)
62
68
  operation('SendTestNotificationToDestination')
63
69
  .add('MarketplaceId' => marketplace_id)
64
70
  .add(build_destination(sqs_queue_url))
@@ -73,7 +79,8 @@ module MWS
73
79
  # @param [String] sqs_queue_url
74
80
  # @param [String] marketplace_id
75
81
  # @return [Peddler::XMLParser]
76
- def create_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id)
82
+ def create_subscription(notification_type, sqs_queue_url,
83
+ marketplace_id = primary_marketplace_id)
77
84
  operation('CreateSubscription')
78
85
  .add('MarketplaceId' => marketplace_id)
79
86
  .add(build_subscription(notification_type, sqs_queue_url))
@@ -88,7 +95,8 @@ module MWS
88
95
  # @param [String] sqs_queue_url
89
96
  # @param [String] marketplace_id
90
97
  # @return [Peddler::XMLParser]
91
- def get_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id)
98
+ def get_subscription(notification_type, sqs_queue_url,
99
+ marketplace_id = primary_marketplace_id)
92
100
  operation('GetSubscription')
93
101
  .add(
94
102
  'MarketplaceId' => marketplace_id,
@@ -106,7 +114,8 @@ module MWS
106
114
  # @param [String] sqs_queue_url
107
115
  # @param [String] marketplace_id
108
116
  # @return [Peddler::XMLParser]
109
- def delete_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id)
117
+ def delete_subscription(notification_type, sqs_queue_url,
118
+ marketplace_id = primary_marketplace_id)
110
119
  operation('DeleteSubscription')
111
120
  .add(
112
121
  'MarketplaceId' => marketplace_id,
@@ -137,7 +146,8 @@ module MWS
137
146
  # @param [Boolean] enabled
138
147
  # @param [String] marketplace_id
139
148
  # @return [Peddler::XMLParser]
140
- def update_subscription(notification_type, sqs_queue_url, enabled, marketplace_id = primary_marketplace_id)
149
+ def update_subscription(notification_type, sqs_queue_url, enabled,
150
+ marketplace_id = primary_marketplace_id)
141
151
  operation('UpdateSubscription')
142
152
  .add('MarketplaceId' => marketplace_id)
143
153
  .add(build_subscription(notification_type, sqs_queue_url, enabled))
@@ -169,8 +179,10 @@ module MWS
169
179
  'Subscription.IsEnabled' => enabled,
170
180
  'Subscription.NotificationType' => notification_type,
171
181
  'Subscription.Destination.DeliveryChannel' => 'SQS',
172
- 'Subscription.Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
173
- 'Subscription.Destination.AttributeList.member.1.Value' => sqs_queue_url
182
+ 'Subscription.Destination.AttributeList.member.1.Key' =>
183
+ 'sqsQueueUrl',
184
+ 'Subscription.Destination.AttributeList.member.1.Value' =>
185
+ sqs_queue_url
174
186
  }
175
187
  end
176
188
  end
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mws'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'forwardable'
2
4
  require 'jeff'
3
5
  require 'peddler/errors/parser'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'singleton'
2
4
  require 'peddler/errors/error'
3
5
 
@@ -1,9 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Peddler
2
4
  # @api private
3
5
  module Errors
4
6
  # Known codes
5
7
  CODES = %w[
6
8
  AccessDenied
9
+ InternalError
10
+ InvalidAccessKeyId
7
11
  InvalidMarketplace
8
12
  InvalidParameterValue
9
13
  InvalidRequest
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'excon'
2
4
  require 'peddler/errors/builder'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'peddler/xml_parser'
2
4
 
3
5
  module Peddler
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'delegate'
2
4
  require 'csv'
3
5
  require 'digest/md5'
@@ -34,7 +36,8 @@ module Peddler
34
36
  private
35
37
 
36
38
  def scrub_body!(encoding)
37
- body.force_encoding(encoding) unless body.encoding == Encoding::UTF_8
39
+ return if body.encoding == Encoding::UTF_8
40
+ self.body = body.dup.force_encoding(encoding)
38
41
  end
39
42
 
40
43
  def extract_content_and_summary
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Peddler
2
4
  # Parses MWS-specific headers
3
5
  module Headers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Peddler
2
4
  # @api private
3
5
  # @see https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'delegate'
2
4
  require 'time'
3
5
  require 'peddler/structured_list'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'peddler/flat_file_parser'
2
4
  require 'peddler/xml_response_parser'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Peddler
2
4
  # @api private
3
5
  class StructuredList
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Peddler
2
4
  # A custom matcher that can be used to record MWS interactions when
3
5
  # integration-testing
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Peddler
4
- VERSION = '1.6.3'.freeze
4
+ VERSION = '1.6.4'
5
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'delegate'
2
4
  require 'dig_rb'
3
5
  require 'forwardable'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'peddler/xml_parser'
2
4
 
3
5
  module Peddler
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+ require 'yaml'
5
+
6
+ module Credentials
7
+ class <<self
8
+ extend Forwardable
9
+ include Enumerable
10
+
11
+ attr_reader :all
12
+
13
+ def_delegators :all, :each
14
+ end
15
+
16
+ %w[mws.yml mws.yml.example].each do |path|
17
+ file = File.expand_path("../#{path}", __FILE__)
18
+ if File.exist?(file)
19
+ @all = YAML.load_file(file)
20
+ break
21
+ end
22
+ end
23
+ end