canvas_sync 0.17.6 → 0.17.7.beta1

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: 06f6a868c0dd531a98b7999e7c132f75edb211856dd84ef5519e47b4634a0001
4
- data.tar.gz: e305790ec6923cea6eabc085b67105b3ac6f66ea3f5eaf35083d3bfb552a5558
3
+ metadata.gz: dce8b98794dc361c339eee16174fd5444df5e59b20a556de679d6308557a0285
4
+ data.tar.gz: 661f36b657c10a887cb8f1b7fc20af78e2790ed0ea08f2d1ead09d2a0118751e
5
5
  SHA512:
6
- metadata.gz: fd34b80603ecaf90040446cb998e4ce7f33e4ed28c29436aee0ad5a017119d1187b0dbc7961f4300a542a97cef7af051428ba30ced733c68c085b609fcb4c225
7
- data.tar.gz: e8227d369bbf5fab0f4bf8b4fcb90310a197986fa1a8f85c56689ab521ec9abfcc59ff6b4601b66a50742873aa1f98e969038f62ca1dca19a568e081a8f3e14a
6
+ metadata.gz: 8b952769ecfdb561ae22be39168614aa69a1d93eea3811ac4809e5b605a807887dc97db1af64acd140be0399b4a73f0d61076d645f0ebacee772370e27880d91
7
+ data.tar.gz: 60ccba0f231646e5b3634c16c525ca3fda187cf454ed91c0aabe93d2121a2a9a423c43fdac91019262a2129b1f3741af98fa3a6854b16e1a9e0445ff2c2c305c
@@ -56,12 +56,11 @@ module CanvasSync
56
56
  placement = kwargs.keys[0]
57
57
  relative_to = kwargs.values[0]
58
58
 
59
- matching_jobs = find_matching_jobs(relative_to)
59
+ matching_jobs = find_matching_jobs(relative_to).to_a
60
60
  raise "Could not find a \"#{relative_to}\" job in the chain" if matching_jobs.count == 0
61
61
  raise "Found multiple \"#{relative_to}\" jobs in the chain" if matching_jobs.count > 1
62
62
 
63
- relative_job, sub_index = matching_jobs[0]
64
- parent_job = find_parent_job(relative_job)
63
+ relative_job, parent_job, sub_index = matching_jobs[0]
65
64
  needed_parent_type = placement == :with ? ConcurrentBatchJob : SerialBatchJob
66
65
 
67
66
  chain = self.class.get_chain_parameter(parent_job)
@@ -91,7 +90,7 @@ module CanvasSync
91
90
  raise "Found multiple \"#{sub_type}\" jobs in the chain" if matching_jobs.count > 1
92
91
  return nil if matching_jobs.count == 0
93
92
 
94
- new(matching_jobs[0])
93
+ new(matching_jobs[0][0])
95
94
  end
96
95
 
97
96
  def normalize!(job_def = self.base_job)
@@ -108,9 +107,7 @@ module CanvasSync
108
107
 
109
108
  # Legacy Support
110
109
  def merge_options(job, options)
111
- matching_jobs = find_matching_jobs(job)
112
-
113
- matching_jobs.each do |j|
110
+ find_matching_jobs(job).each do |j, parent, index|
114
111
  j[:options] ||= {}
115
112
  j[:options].deep_merge!(options)
116
113
  end
@@ -124,9 +121,9 @@ module CanvasSync
124
121
  sub_jobs = self.class.get_chain_parameter(parent_job)
125
122
  sub_jobs.each_with_index do |sub_job, i|
126
123
  if sub_job[:job].to_s == search_job.to_s
127
- yield [parent_job, i]
128
- elsif self.class._job_type_definitions[sub_job[:job]]
129
- find_matching_jobs(search_job) { |item| yield item }
124
+ yield [sub_job, parent_job, i]
125
+ elsif self.class._job_type_definitions[sub_job[:job].to_s]
126
+ find_matching_jobs(search_job, sub_job) { |item| yield item }
130
127
  end
131
128
  end
132
129
  end
@@ -163,7 +160,7 @@ module CanvasSync
163
160
 
164
161
  def get_chain_parameter(job_def, raise_error: true)
165
162
  unless _job_type_definitions[job_def[:job].to_s].present?
166
- raise "Job Type #{base_job[:job].to_s} does not accept a sub-chain" if raise_error
163
+ raise "Job Type #{job_def[:job].to_s} does not accept a sub-chain" if raise_error
167
164
  return nil
168
165
  end
169
166
 
@@ -1,3 +1,3 @@
1
1
  module CanvasSync
2
- VERSION = "0.17.6".freeze
2
+ VERSION = "0.17.7.beta1".freeze
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.17.6
4
+ version: 0.17.7.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Collings
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-17 00:00:00.000000000 Z
11
+ date: 2021-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -644,9 +644,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
644
644
  version: '0'
645
645
  required_rubygems_version: !ruby/object:Gem::Requirement
646
646
  requirements:
647
- - - ">="
647
+ - - ">"
648
648
  - !ruby/object:Gem::Version
649
- version: '0'
649
+ version: 1.3.1
650
650
  requirements: []
651
651
  rubygems_version: 3.0.3
652
652
  signing_key: