job-iteration 1.1.4 → 1.1.5

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: 21dc74805b967b6082859b0c9a07d955f9f77ca3e82f250ceaf4f2aecf4afd7b
4
- data.tar.gz: 23ea1a3e03c8b0578dcf852449204f60e5391bdb92f26987da7d42f45b052595
3
+ metadata.gz: 6bea2b43448343cc53903fdd896e7affd5d168f6c758ddf4b53a9d86de2207b8
4
+ data.tar.gz: f74eabf96862da75494f80f6964c4e9a1611c6f46f66af23a6c8682ec595bcb1
5
5
  SHA512:
6
- metadata.gz: b3b5b27d999f8ea00a443d01857f0483fef67edcd0b0525d8ef8003c8814b9efe1e34713d6f45d0aa2de68c79c2517be141595f37c2501265f04ea6a4da7e0af
7
- data.tar.gz: e47797081fc96034f2fe21746528047cba4f2873a0e6a36a7a38f2265d38a1dcb045f66216c3e9579699d63a9b6416136cf456e630404bb6d5381c433ef7232c
6
+ metadata.gz: 0f32960627142f5fb14c8021e58347b491db9c75338eb323a6a7e3535569669f3f1a6f3482fd388ad471ece1293f5dee74d898384ce0f3d181c73c9adf480cb1
7
+ data.tar.gz: 31a7cebea521cc632716d6f612ff1979f3f5efe4742305d2823a364c06930b9a4ece7043315a2cbb88c37db41c6d90a18dba1713458ea450acae3dd41ea18b79
@@ -4,6 +4,10 @@
4
4
 
5
5
  #### Bug fix
6
6
 
7
+ ## v1.1.5 (February 27, 2020)
8
+
9
+ - [47](https://github.com/Shopify/job-iteration/pull/47) - Optional `sorbet-runtime` support for `JobIteration::Iteration` interface validation
10
+
7
11
  ## v1.1.4 (December 13, 2019)
8
12
 
9
13
  - [45](https://github.com/Shopify/job-iteration/pull/45) - Add Throttle enumerator
data/Gemfile CHANGED
@@ -23,3 +23,6 @@ gem 'mocha'
23
23
  gem 'rubocop', '~> 0.77.0'
24
24
  gem 'yard'
25
25
  gem 'rake'
26
+
27
+ # for unit testing optional sorbet support
28
+ gem 'sorbet-runtime'
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JobIteration
4
+ # Curious about how this works from the SQL perspective?
5
+ # Check "Pagination Done the Right way": https://bit.ly/2Rq7iPF
4
6
  class ActiveRecordCursor # @private
5
7
  include Comparable
6
8
 
@@ -176,7 +176,7 @@ module JobIteration
176
176
  end
177
177
 
178
178
  if respond_to?(:build_enumerator, true)
179
- parameters = method(:build_enumerator).parameters
179
+ parameters = method_parameters(:build_enumerator)
180
180
  unless valid_cursor_parameter?(parameters)
181
181
  raise ArgumentError, "Iteration job (#{self.class}) #build_enumerator " \
182
182
  "expects the keyword argument `cursor`"
@@ -187,6 +187,17 @@ module JobIteration
187
187
  end
188
188
  end
189
189
 
190
+ def method_parameters(method_name)
191
+ method = method(method_name)
192
+
193
+ if defined?(T::Private::Methods)
194
+ signature = T::Private::Methods.signature_for_method(method)
195
+ method = signature.method if signature
196
+ end
197
+
198
+ method.parameters
199
+ end
200
+
190
201
  def iteration_instrumentation_tags
191
202
  { job_class: self.class.name }
192
203
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JobIteration
4
- VERSION = "1.1.4"
4
+ VERSION = "1.1.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: job-iteration
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-13 00:00:00.000000000 Z
11
+ date: 2020-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord