job-iteration 0.9.6 → 0.9.7

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
- SHA1:
3
- metadata.gz: 6093efe949b8033cac444ce502bfe4e68057802c
4
- data.tar.gz: c191823dcf19c97b304ad00cd09f900fc8768eda
2
+ SHA256:
3
+ metadata.gz: ffc9f695ffad79aa7c097581241e0da79c0e7da09e0ab45094135720ac751b84
4
+ data.tar.gz: 1804b93cec0989965f43bb6dcefd62a46873878605ad6e6918c0d6305f69e016
5
5
  SHA512:
6
- metadata.gz: 6fbd13a06347fe7d60062f99ecf4d61544e54cf646f6e07f823e6c889cf4c6d98ba3163324d96f142ed7faebe978f8277ff45c8a69d866f9366a3eb8cdd60a06
7
- data.tar.gz: 7857493464003d53119e93a5bc29a149bb251524ef9a8a5d4b9dfcc00bf843e5de478ea3c2fda537f91b4884eacaf82a412905e1212ef7df4c0b3d6c58fe3cb0
6
+ metadata.gz: 0a58d74621a3f94bdcb22c2cbc097c4700f8ade5cf4b20b7b3307ae802c43f888276b63b85b633cf8e40116432a1f9c8d1c9adee363c355abf86142a8385d3ba
7
+ data.tar.gz: ef8e11855bdafba6ec0c35da341775fd14c4caeb2a708f35f5c2f7f04d14ed4f93d5595e07b65d5e47ef08a492f4ffaa30145f5f5968e1ae8feab3bd609ff4ab
data/.rubocop.yml CHANGED
@@ -11,3 +11,10 @@ Lint/HandleExceptions:
11
11
  Style/GlobalVars:
12
12
  Exclude:
13
13
  - lib/job-iteration/integrations/resque.rb
14
+ Naming/FileName:
15
+ Exclude:
16
+ - lib/job-iteration.rb
17
+ Style/MethodCallWithArgsParentheses:
18
+ Exclude:
19
+ - 'gemfiles/*'
20
+ - Gemfile
data/.travis.yml CHANGED
@@ -12,3 +12,7 @@ script:
12
12
  - bundle exec rake test
13
13
  - bundle exec rubocop
14
14
  - bundle exec yardoc --no-output --no-save --no-stats --fail-on-warning
15
+
16
+ gemfile:
17
+ - 'gemfiles/activejob_5_2.gemfile'
18
+ - 'gemfiles/activejob_edge.gemfile'
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ ### Master (unreleased)
2
+
3
+ #### New feature
4
+
5
+ #### Bug fix
6
+
7
+ ### v0.9.7 (November 30, 2018)
8
+
9
+ #### New feature
10
+
11
+ - [23](https://github.com/shopify/job-iteration/pull/23) - Remove upperbound constraint on ActiveJob
data/Gemfile CHANGED
@@ -11,7 +11,6 @@ gemspec
11
11
  gem 'sidekiq'
12
12
  gem 'resque'
13
13
 
14
- gem 'activerecord'
15
14
  gem 'mysql2', '~> 0.4.4'
16
15
  gem 'globalid'
17
16
  gem 'i18n'
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- job-iteration (0.9.6)
5
- activejob (~> 5.2)
4
+ job-iteration (0.9.7)
5
+ activejob (>= 5.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -112,4 +112,4 @@ DEPENDENCIES
112
112
  yard
113
113
 
114
114
  BUNDLED WITH
115
- 1.16.6
115
+ 1.17.1
data/Rakefile CHANGED
@@ -9,4 +9,4 @@ Rake::TestTask.new(:test) do |t|
9
9
  t.test_files = FileList["test/**/*_test.rb"]
10
10
  end
11
11
 
12
- task default: :test
12
+ task(default: :test)
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ eval_gemfile '../Gemfile'
4
+
5
+ gem 'activejob', '~> 5.2.0'
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ eval_gemfile '../Gemfile'
4
+
5
+ gem 'activejob', github: 'rails/rails'
6
+ gem 'activerecord', github: 'rails/rails'
@@ -15,16 +15,19 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = "https://github.com/shopify/job-iteration"
16
16
  spec.license = "MIT"
17
17
 
18
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ spec.files = %x(git ls-files -z).split("\x0").reject do |f|
19
19
  f.match(%r{^(test|spec|features)/})
20
20
  end
21
21
  spec.bindir = "exe"
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = %w(lib)
24
24
 
25
- spec.add_dependency "activejob", "~> 5.2"
25
+ spec.metadata["changelog_uri"] = "https://github.com/Shopify/job-iteration/blob/master/CHANGELOG.md"
26
26
 
27
- spec.add_development_dependency "bundler", "~> 1.16"
28
- spec.add_development_dependency "rake", "~> 10.0"
29
- spec.add_development_dependency "minitest", "~> 5.0"
27
+ spec.add_dependency("activejob", ">= 5.2")
28
+
29
+ spec.add_development_dependency("bundler", "~> 1.16")
30
+ spec.add_development_dependency("rake", "~> 10.0")
31
+ spec.add_development_dependency("minitest", "~> 5.0")
32
+ spec.add_development_dependency("activerecord")
30
33
  end
@@ -55,7 +55,7 @@ module JobIteration
55
55
  return
56
56
  end
57
57
 
58
- count = `wc -l < #{filepath}`.strip.to_i
58
+ count = %x(wc -l < #{filepath}).strip.to_i
59
59
  count -= 1 if @csv.headers
60
60
  count
61
61
  end
@@ -94,15 +94,15 @@ module JobIteration
94
94
  end
95
95
 
96
96
  unless enumerator
97
- logger.info "[JobIteration::Iteration] `build_enumerator` returned nil. " \
98
- "Skipping the job."
97
+ logger.info("[JobIteration::Iteration] `build_enumerator` returned nil. " \
98
+ "Skipping the job.")
99
99
  return
100
100
  end
101
101
 
102
102
  assert_enumerator!(enumerator)
103
103
 
104
104
  if executions == 1 && times_interrupted == 0
105
- run_callbacks :start
105
+ run_callbacks(:start)
106
106
  else
107
107
  ActiveSupport::Notifications.instrument("resumed.iteration", iteration_instrumentation_tags)
108
108
  end
@@ -111,10 +111,10 @@ module JobIteration
111
111
  iterate_with_enumerator(enumerator, arguments)
112
112
  end
113
113
 
114
- run_callbacks :shutdown
114
+ run_callbacks(:shutdown)
115
115
 
116
116
  if run_complete_callbacks?(completed)
117
- run_callbacks :complete
117
+ run_callbacks(:complete)
118
118
  output_interrupt_summary
119
119
  end
120
120
  end
@@ -144,7 +144,7 @@ module JobIteration
144
144
 
145
145
  def reenqueue_iteration_job
146
146
  ActiveSupport::Notifications.instrument("interrupted.iteration", iteration_instrumentation_tags)
147
- logger.info "[JobIteration::Iteration] Interrupting and re-enqueueing the job cursor_position=#{cursor_position}"
147
+ logger.info("[JobIteration::Iteration] Interrupting and re-enqueueing the job cursor_position=#{cursor_position}")
148
148
 
149
149
  adjust_total_time
150
150
  self.times_interrupted += 1
@@ -194,7 +194,7 @@ module JobIteration
194
194
  adjust_total_time
195
195
 
196
196
  message = "[JobIteration::Iteration] Completed iterating. times_interrupted=%d total_time=%.3f"
197
- logger.info Kernel.format(message, times_interrupted, total_time)
197
+ logger.info(Kernel.format(message, times_interrupted, total_time))
198
198
  end
199
199
 
200
200
  def job_should_exit?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JobIteration
4
- VERSION = "0.9.6"
4
+ VERSION = "0.9.7"
5
5
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: job-iteration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-07 00:00:00.000000000 Z
11
+ date: 2018-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '5.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5.2'
27
27
  - !ruby/object:Gem::Dependency
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '5.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: activerecord
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: Makes your background jobs interruptible and resumable.
70
84
  email:
71
85
  - ops-accounts+shipit@shopify.com
@@ -77,6 +91,7 @@ files:
77
91
  - ".rubocop.yml"
78
92
  - ".travis.yml"
79
93
  - ".yardopts"
94
+ - CHANGELOG.md
80
95
  - CODE_OF_CONDUCT.md
81
96
  - Gemfile
82
97
  - Gemfile.lock
@@ -85,6 +100,8 @@ files:
85
100
  - Rakefile
86
101
  - bin/setup
87
102
  - dev.yml
103
+ - gemfiles/activejob_5_2.gemfile
104
+ - gemfiles/activejob_edge.gemfile
88
105
  - guides/best-practices.md
89
106
  - guides/custom-enumerator.md
90
107
  - guides/iteration-how-it-works.md
@@ -103,7 +120,8 @@ files:
103
120
  homepage: https://github.com/shopify/job-iteration
104
121
  licenses:
105
122
  - MIT
106
- metadata: {}
123
+ metadata:
124
+ changelog_uri: https://github.com/Shopify/job-iteration/blob/master/CHANGELOG.md
107
125
  post_install_message:
108
126
  rdoc_options: []
109
127
  require_paths:
@@ -120,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
138
  version: '0'
121
139
  requirements: []
122
140
  rubyforge_project:
123
- rubygems_version: 2.6.14
141
+ rubygems_version: 2.7.6
124
142
  signing_key:
125
143
  specification_version: 4
126
144
  summary: Makes your background jobs interruptible and resumable.