peddler 0.6.4 → 0.6.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 480feed5c44724e4f6ef152ec3c1da23075f4a11
4
- data.tar.gz: d1e0ddcb314cd41e28f143f3f0304706f25f0af3
3
+ metadata.gz: 62f6b3aebec5618ad516b43e57dff82844a884a9
4
+ data.tar.gz: 24fd012b9a57b57b7a1d159f9ca4c80bfba988d7
5
5
  SHA512:
6
- metadata.gz: 58305a7973578fb6ca7153a28319db391b5075f76d9efe988a9a14dfe16a4c576249e26de4ad7e28f31b1a6a7971a4228f7e804b1a24411eaaf1e78e52f1b768
7
- data.tar.gz: 500bbaf3efcf364737439c20518a84b5191788a12f4f10bb25fb9636f86fdcf72a1720b5bf11a686fa338da07c4a0dc4adf9e498b090d956469fa8ca7de420fd
6
+ metadata.gz: 52dad3122e6cbcba62d4633c170605d7f139246fe0d1ce82745778c86af8894e4b7e602fe0b0f5497e7579a0736f1531818cf16309e9ca0f6773e71e8b590ff6
7
+ data.tar.gz: e00f2f55e5a88ebad2080c9b17c41f1d86b6e4fbabf293ba64b32dad0a7a05e37f245321edccd5617b92cb858f6bf7698e65214cf56b9edbba3c7b8e3a13cd6d
@@ -1,5 +1,5 @@
1
+ require 'mws/reports/requests/report_request'
1
2
  require 'mws/reports/requests/report_request_list'
2
- require 'mws/reports/requests/report_request_info'
3
3
  require 'mws/reports/requests/report_request_count'
4
4
  require 'mws/reports/requests/report_requests'
5
5
  require 'mws/reports/requests/report_list'
@@ -26,7 +26,7 @@ module MWS
26
26
  # client.request_report('_GET_ORDERS_DATA_')
27
27
  #
28
28
  # Returns the Report Request Info.
29
- def_delegator :report_request_info, :request, :request_report
29
+ def_delegator :report_request, :submit, :request_report
30
30
 
31
31
  # Public: Get a list of report requests submitted during a specified time
32
32
  # frame.
@@ -201,8 +201,8 @@ module MWS
201
201
 
202
202
  private
203
203
 
204
- def report_request_info
205
- @report_request_info ||= Requests::ReportRequestInfo.new(self)
204
+ def report_request
205
+ @report_request ||= Requests::ReportRequest.new(self)
206
206
  end
207
207
 
208
208
  def report_request_list
@@ -0,0 +1,14 @@
1
+ require 'peddler/parsers/model'
2
+ require 'mws/reports/parsers/report_request_info'
3
+
4
+ module MWS
5
+ module Reports
6
+ module Parsers
7
+ class ReportRequest < Peddler::Parsers::Model
8
+ value :info do
9
+ ReportRequestInfo.new(at_xpath('ReportRequestInfo'))
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,13 +1,13 @@
1
1
  require 'peddler/request'
2
- require 'mws/reports/parsers/report_request_info'
2
+ require 'mws/reports/parsers/report_request'
3
3
 
4
4
  module MWS
5
5
  module Reports
6
6
  module Requests
7
- class ReportRequestInfo < ::Peddler::Request
8
- def request(type, options = {})
7
+ class ReportRequest < ::Peddler::Request
8
+ def submit(type, options = {})
9
9
  parameters(:request_report)
10
- .update(type: type)
10
+ .update(report_type: type)
11
11
  .update(options)
12
12
  .timestamp!
13
13
  .format_structured_lists!
@@ -1,3 +1,3 @@
1
1
  module Peddler
2
- VERSION = '0.6.4'
2
+ VERSION = '0.6.5'
3
3
  end
@@ -12,8 +12,8 @@ class FeedRequestTest < RequestTest
12
12
  <SubmittedDate>2009-02-20T02:10:35+00:00</SubmittedDate>
13
13
  <FeedProcessingStatus>_CANCELLED_</FeedProcessingStatus>
14
14
  </FeedSubmissionInfo>
15
- </Response>
16
- </Result>
15
+ </Result>
16
+ </Response>
17
17
  EOF
18
18
  end
19
19
 
@@ -7,8 +7,8 @@ class FeedSubmissionCountRequestTest < RequestTest
7
7
  <Response xmlns="ns">
8
8
  <Result>
9
9
  <Count>1</Count>
10
- </Response>
11
- </Result>
10
+ </Result>
11
+ </Response>
12
12
  EOF
13
13
  end
14
14
 
@@ -13,8 +13,8 @@ class FeedSubmissionListRequestTest < RequestTest
13
13
  <SubmittedDate>2009-02-20T02:10:35+00:00</SubmittedDate>
14
14
  <FeedProcessingStatus>_SUBMITTED_</FeedProcessingStatus>
15
15
  </FeedSubmissionInfo>
16
- </Response>
17
- </Result>
16
+ </Result>
17
+ </Response>
18
18
  EOF
19
19
  end
20
20
 
@@ -13,8 +13,8 @@ class FeedSubmissionsRequesttTest < RequestTest
13
13
  <SubmittedDate>2009-02-20T02:10:35+00:00</SubmittedDate>
14
14
  <FeedProcessingStatus>_CANCELLED_</FeedProcessingStatus>
15
15
  </FeedSubmissionInfo>
16
- </Response>
17
- </Result>
16
+ </Result>
17
+ </Response>
18
18
  EOF
19
19
  end
20
20
 
@@ -0,0 +1,13 @@
1
+ require 'parser_helper'
2
+ require 'mws/reports/parsers/report_request'
3
+
4
+ class ReportRequestParserTest < ParserTest
5
+ def setup
6
+ node = fixture('reports/report_request_list').xpath('//xmlns:GetReportRequestListResult')
7
+ @request = MWS::Reports::Parsers::ReportRequest.new(node)
8
+ end
9
+
10
+ def test_report_request_info
11
+ refute_nil @request.info
12
+ end
13
+ end
@@ -15,8 +15,8 @@ class ReportAcknowledgementsTest < RequestTest
15
15
  <Acknowledged>true</Acknowledged>
16
16
  <AcknowledgedDate>2009-02-20T02:10:41+00:00</AcknowledgedDate>
17
17
  </ReportInfo>
18
- </Response>
19
- </Result>
18
+ </Result>
19
+ </Response>
20
20
  EOF
21
21
  end
22
22
 
@@ -7,8 +7,8 @@ class ReportCountRequestTest < RequestTest
7
7
  <Response xmlns="ns">
8
8
  <Result>
9
9
  <Count>1</Count>
10
- </Response>
11
- </Result>
10
+ </Result>
11
+ </Response>
12
12
  EOF
13
13
  end
14
14
 
@@ -0,0 +1,31 @@
1
+ require 'request_helper'
2
+ require 'mws/reports/requests/report_request'
3
+
4
+ class ReportRequestSubmitTest < RequestTest
5
+ def mock_response_body
6
+ <<-EOF
7
+ <Response xmlns="ns">
8
+ <Result>
9
+ <ReportRequestInfo>
10
+ <ReportRequestId>2291326454</ReportRequestId>
11
+ <ReportType>_GET_MERCHANT_LISTINGS_DATA_</ReportType>
12
+ <StartDate>2009-01-21T02:10:39+00:00</StartDate>
13
+ <EndDate>2009-02-13T02:10:39+00:00</EndDate>
14
+ <Scheduled>false</Scheduled>
15
+ <SubmittedDate>2009-02-20T02:10:39+00:00</SubmittedDate>
16
+ <ReportProcessingStatus>_SUBMITTED_</ReportProcessingStatus>
17
+ </ReportRequestInfo>
18
+ </Result>
19
+ </Response>
20
+ EOF
21
+ end
22
+
23
+ def setup
24
+ @report_request = MWS::Reports::Requests::ReportRequest.new(mock_client)
25
+ end
26
+
27
+ def test_submits_report_request
28
+ res = @report_request.submit('_GET_MERCHANT_LISTINGS_DATA_')
29
+ assert_kind_of MWS::Reports::Parsers::ReportRequest, res
30
+ end
31
+ end
@@ -12,8 +12,8 @@ class ReportSchedulerRequestTest < RequestTest
12
12
  <Schedule>_30_DAYS_</Schedule>
13
13
  <ScheduledDate>2009-02-20T02:10:42+00:00</ScheduledDate>
14
14
  </ReportSchedule>
15
- </Response>
16
- </Result>
15
+ </Result>
16
+ </Response>
17
17
  EOF
18
18
  end
19
19
 
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: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hakan Ensari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-15 00:00:00.000000000 Z
11
+ date: 2014-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jeff
@@ -178,6 +178,7 @@ files:
178
178
  - lib/mws/reports/parsers/report_count.rb
179
179
  - lib/mws/reports/parsers/report_info.rb
180
180
  - lib/mws/reports/parsers/report_list.rb
181
+ - lib/mws/reports/parsers/report_request.rb
181
182
  - lib/mws/reports/parsers/report_request_count.rb
182
183
  - lib/mws/reports/parsers/report_request_info.rb
183
184
  - lib/mws/reports/parsers/report_request_list.rb
@@ -190,8 +191,8 @@ files:
190
191
  - lib/mws/reports/requests/report_acknowledgements.rb
191
192
  - lib/mws/reports/requests/report_count.rb
192
193
  - lib/mws/reports/requests/report_list.rb
194
+ - lib/mws/reports/requests/report_request.rb
193
195
  - lib/mws/reports/requests/report_request_count.rb
194
- - lib/mws/reports/requests/report_request_info.rb
195
196
  - lib/mws/reports/requests/report_request_list.rb
196
197
  - lib/mws/reports/requests/report_requests.rb
197
198
  - lib/mws/reports/requests/report_schedule_count.rb
@@ -291,6 +292,7 @@ files:
291
292
  - test/mws/reports/parsers/test_report_count.rb
292
293
  - test/mws/reports/parsers/test_report_info.rb
293
294
  - test/mws/reports/parsers/test_report_list.rb
295
+ - test/mws/reports/parsers/test_report_request.rb
294
296
  - test/mws/reports/parsers/test_report_request_count.rb
295
297
  - test/mws/reports/parsers/test_report_request_info.rb
296
298
  - test/mws/reports/parsers/test_report_request_list.rb
@@ -300,8 +302,8 @@ files:
300
302
  - test/mws/reports/parsers/test_report_scheduler.rb
301
303
  - test/mws/reports/requests/test_acknowledgements.rb
302
304
  - test/mws/reports/requests/test_report_count.rb
303
- - test/mws/reports/requests/test_report_info.rb
304
305
  - test/mws/reports/requests/test_report_list.rb
306
+ - test/mws/reports/requests/test_report_request.rb
305
307
  - test/mws/reports/requests/test_report_request_count.rb
306
308
  - test/mws/reports/requests/test_report_request_list.rb
307
309
  - test/mws/reports/requests/test_report_requests.rb
@@ -409,6 +411,7 @@ test_files:
409
411
  - test/mws/reports/parsers/test_report_count.rb
410
412
  - test/mws/reports/parsers/test_report_info.rb
411
413
  - test/mws/reports/parsers/test_report_list.rb
414
+ - test/mws/reports/parsers/test_report_request.rb
412
415
  - test/mws/reports/parsers/test_report_request_count.rb
413
416
  - test/mws/reports/parsers/test_report_request_info.rb
414
417
  - test/mws/reports/parsers/test_report_request_list.rb
@@ -418,8 +421,8 @@ test_files:
418
421
  - test/mws/reports/parsers/test_report_scheduler.rb
419
422
  - test/mws/reports/requests/test_acknowledgements.rb
420
423
  - test/mws/reports/requests/test_report_count.rb
421
- - test/mws/reports/requests/test_report_info.rb
422
424
  - test/mws/reports/requests/test_report_list.rb
425
+ - test/mws/reports/requests/test_report_request.rb
423
426
  - test/mws/reports/requests/test_report_request_count.rb
424
427
  - test/mws/reports/requests/test_report_request_list.rb
425
428
  - test/mws/reports/requests/test_report_requests.rb
@@ -1,29 +0,0 @@
1
- require 'request_helper'
2
- require 'mws/reports/requests/report_request_info'
3
-
4
- class ReportRequestInfoTest < RequestTest
5
- def mock_response_body
6
- <<-EOF
7
- <Result xmlns="ns">
8
- <ReportRequestInfo>
9
- <ReportRequestId>2291326454</ReportRequestId>
10
- <ReportType>_GET_MERCHANT_LISTINGS_DATA_</ReportType>
11
- <StartDate>2009-01-21T02:10:39+00:00</StartDate>
12
- <EndDate>2009-02-13T02:10:39+00:00</EndDate>
13
- <Scheduled>false</Scheduled>
14
- <SubmittedDate>2009-02-20T02:10:39+00:00</SubmittedDate>
15
- <ReportProcessingStatus>_SUBMITTED_</ReportProcessingStatus>
16
- </ReportRequestInfo>
17
- </Result>
18
- EOF
19
- end
20
-
21
- def setup
22
- @report = MWS::Reports::Requests::ReportRequestInfo.new(mock_client)
23
- end
24
-
25
- def test_requests_report
26
- res = @report.request('_GET_FLAT_FILE_OPEN_LISTINGS_DATA_')
27
- assert_kind_of MWS::Reports::Parsers::ReportRequestInfo, res
28
- end
29
- end