canvas_sync 0.6.4 → 0.7.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43aa8c7cbb9c2e7fb87ec7a95e6e961ea80f374c9a07af33e63d23a71533e3ab
|
4
|
+
data.tar.gz: ab8de377459dc4d3903fc8e96d9ca6c77478cb61c46abf2dfa545e803ba166ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/lib/canvas_sync/version.rb
CHANGED
@@ -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
|