canvas_sync 0.6.4 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a57e57d039eb1106619e3cd1019942b7a51e707df471cc7e8c46fe69840189ba
4
- data.tar.gz: 0702bf4968ffe18532759d0c6a03d7e6ca73eb0a23b675825ee12939325e9f33
3
+ metadata.gz: 43aa8c7cbb9c2e7fb87ec7a95e6e961ea80f374c9a07af33e63d23a71533e3ab
4
+ data.tar.gz: ab8de377459dc4d3903fc8e96d9ca6c77478cb61c46abf2dfa545e803ba166ae
5
5
  SHA512:
6
- metadata.gz: 46f2fde7c43f048bfe531116311f8794da7f27a3de4cd31efda024a08f7421f77b3b95fd84fb31067fa62a4b4d4ac12e44b923f45bc61bed37e10bddea1ab2cf
7
- data.tar.gz: ea5acb8a77a3a187dabe416b4d6debdd52f10e3c4b4136e7958988868af97734c79498faaec8046dd5cdb0c34cda24095cb1184f4695cee0a95978b5ffb40dcd
6
+ metadata.gz: 75eaf9c0967cc171e53dd81107c9fa29594aadd9368b086bf018c42c0e046085a46a1f701cd29fe67986b48b28ee43c32bf895c58fbab8c6171911b0a44beae1
7
+ data.tar.gz: 1607119a5dce46ff0f28b88b139081046745c2138f219021989208f0fcbd49ce40f92c2c0519fba992dd98831aab8c74c8da8ef6503841c388e6e45fc3a7bef2
@@ -23,6 +23,7 @@ module CanvasSync
23
23
  report_status["attachment"]["url"],
24
24
  processor,
25
25
  options,
26
+ report_id,
26
27
  )
27
28
  when "error", "deleted"
28
29
  message = "Report failed to process; status was #{report_status} for report_name: #{report_name}, report_id: #{report_id}" # rubocop:disable Metrics/LineLength
@@ -12,11 +12,11 @@ module CanvasSync
12
12
  # @param processor [String] a stringified report processor class name
13
13
  # @param options [Hash] hash of options that will be passed to the job processor
14
14
  # @return [nil]
15
- def perform(job_chain, report_name, report_url, processor, options)
15
+ def perform(job_chain, report_name, report_url, processor, options, report_id)
16
16
  @job_log.update_attributes(job_class: processor)
17
17
  download(report_name, report_url) do |file_path|
18
18
  options = job_chain[:global_options].merge(options)
19
- processor.constantize.process(file_path, options)
19
+ processor.constantize.process(file_path, options, report_id)
20
20
  end
21
21
 
22
22
  CanvasSync.invoke_next(job_chain)
@@ -1,3 +1,3 @@
1
1
  module CanvasSync
2
- VERSION = "0.6.4".freeze
2
+ VERSION = "0.7.0".freeze
3
3
  end
@@ -25,7 +25,7 @@ RSpec.describe CanvasSync::Jobs::ReportChecker do
25
25
  .and_return({ 'status' => 'complete', 'attachment' => { 'url' => 'blah' } })
26
26
 
27
27
  expect(CanvasSync::Jobs::ReportProcessorJob).to receive(:perform_later)
28
- .with(job_chain, report_name, 'blah', processor, {})
28
+ .with(job_chain, report_name, 'blah', processor, {}, report_id)
29
29
 
30
30
  start_job
31
31
  end
@@ -7,6 +7,7 @@ RSpec.describe CanvasSync::Jobs::ReportProcessorJob do
7
7
  let(:report_url) { 'https://test.instructure.com/sample_report_download' }
8
8
  let(:processor) { FakeProcessor.to_s }
9
9
  let(:job_chain) { { jobs: [], global_options: {} } }
10
+ let(:report_id) { 1 }
10
11
 
11
12
  describe '#perform' do
12
13
  it 'downloads the report to a file and then calls the process method on the processor, and then invokes the next job' do
@@ -19,7 +20,8 @@ RSpec.describe CanvasSync::Jobs::ReportProcessorJob do
19
20
  report_name,
20
21
  report_url,
21
22
  processor,
22
- {}
23
+ {},
24
+ report_id,
23
25
  )
24
26
  end
25
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Collings