canvas_sync 0.3.2 → 0.3.3

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
  SHA1:
3
- metadata.gz: 9ef8df28c558a21b5843f195f807b091efcc2cd0
4
- data.tar.gz: '0549a9d1691f509116fbc136552b6ed2847ee8e1'
3
+ metadata.gz: 4cb4e4d83e146469a152b7582f9dff23adbf57e5
4
+ data.tar.gz: 7ac7ec7146259a6099093c63134a070af1656a07
5
5
  SHA512:
6
- metadata.gz: d4712ea7567083b38968a4256e419546e126466886f1b81898bb018943f01c4471c326f5364d65e390b79ccc8fd26f8240868784847fce9f7748f082e4ed8fe2
7
- data.tar.gz: ccd1e2beecb5651f511616ac56848e9282b108188831ca7ee811723ae7d14fadc736fe1a5bc605b7bde9aa3ad82804aaf711a7716718e29a6bc3cae322b0d8f5
6
+ metadata.gz: 1b98e4574ce7bce06cfba710c003fe8e8b4bf48b3f84326307d099bc9ab80136384c367ef4913e85a80331e4f0a855e41c40ea89e5cb4f30dec7af9e81c7585e
7
+ data.tar.gz: d572b58ae50eab9287e04972f79a72f0619cb25623a8615d4c2e55f93f58d54c9232e5371ffce4d844405380fb8c7e4e4d5706909f88f730d75878ddab10280a
@@ -11,29 +11,30 @@ module CanvasSync
11
11
  # @param options [Hash] hash of options that will be passed to the job processor
12
12
  # @return [nil]
13
13
  def perform(job_chain, report_name, report_id, processor, options)
14
- report_status = CanvasSync.get_canvas_sync_client(job_chain[:global_options]).report_status('self', report_name, report_id)
14
+ account_id = options[:account_id] || job_chain[:global_options][:account_id] || 'self'
15
+ report_status = CanvasSync.get_canvas_sync_client(job_chain[:global_options]).report_status(account_id, report_name, report_id)
15
16
 
16
17
  case report_status['status'].downcase
17
- when 'complete'
18
- CanvasSync::Jobs::ReportProcessorJob.perform_later(
18
+ when 'complete'
19
+ CanvasSync::Jobs::ReportProcessorJob.perform_later(
19
20
  job_chain,
20
21
  report_name,
21
22
  report_status['attachment']['url'],
22
23
  processor,
23
24
  options
24
- )
25
- when 'error', 'deleted'
26
- message = "Report failed to process; status was #{report_status} for report_name: #{report_name}, report_id: #{report_id}"
27
- Rails.logger.error(message)
28
- raise message
29
- else
30
- CanvasSync::Jobs::ReportChecker.set(wait: report_checker_wait_time)
25
+ )
26
+ when 'error', 'deleted'
27
+ message = "Report failed to process; status was #{report_status} for report_name: #{report_name}, report_id: #{report_id}"
28
+ Rails.logger.error(message)
29
+ raise message
30
+ else
31
+ CanvasSync::Jobs::ReportChecker.set(wait: report_checker_wait_time)
31
32
  .perform_later(
32
- job_chain,
33
- report_name,
34
- report_id,
35
- processor,
36
- options
33
+ job_chain,
34
+ report_name,
35
+ report_id,
36
+ processor,
37
+ options
37
38
  )
38
39
  end
39
40
  end
@@ -15,10 +15,7 @@ module CanvasSync
15
15
  def perform(job_chain, report_name, report_url, processor, options)
16
16
  @job_log.update_attributes(job_class: processor)
17
17
  download(report_name, report_url) do |file_path|
18
- options = options.merge({
19
- legacy_support: job_chain[:global_options][:legacy_support],
20
- account_id: job_chain[:global_options][:account_id]
21
- })
18
+ options = job_chain[:global_options].merge(options)
22
19
  processor.constantize.process(file_path, options)
23
20
  end
24
21
 
@@ -9,14 +9,15 @@ module CanvasSync
9
9
  # @param options [Hash] hash of options that will be passed to the job processor
10
10
  # @return [nil]
11
11
  def perform(job_chain, report_name, report_params, processor, options)
12
- report = CanvasSync.get_canvas_sync_client(job_chain[:global_options]).start_report('self', report_name, report_params)
12
+ account_id = options[:account_id] || job_chain[:global_options][:account_id] || 'self'
13
+ report = CanvasSync.get_canvas_sync_client(job_chain[:global_options]).start_report(account_id, report_name, report_params)
13
14
 
14
15
  CanvasSync::Jobs::ReportChecker.set(wait: report_checker_wait_time).perform_later(
15
- job_chain,
16
- report_name,
17
- report['id'],
18
- processor,
19
- options
16
+ job_chain,
17
+ report_name,
18
+ report['id'],
19
+ processor,
20
+ options
20
21
  )
21
22
  end
22
23
  end
@@ -1,3 +1,3 @@
1
1
  module CanvasSync
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Collings
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-27 00:00:00.000000000 Z
11
+ date: 2017-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler