Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Ruby 2.6 & Rails 5.2 due to EOL #241

Merged
merged 3 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@ jobs:
- 6379:6379
strategy:
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1"]
gemfile: [rails_5_2, rails_6_0, rails_6_1, rails_7_0, rails_edge]
ruby: ["2.7", "3.0", "3.1"]
gemfile: [rails_6_0, rails_6_1, rails_7_0, rails_edge]
exclude:
- ruby: "2.6"
gemfile: rails_7_0
- ruby: "2.6"
gemfile: rails_edge
- ruby: "3.0"
gemfile: rails_5_2
- ruby: "3.1"
gemfile: rails_5_2
- ruby: "3.1"
gemfile: rails_6_0
include:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inherit_gem:
rubocop-shopify: rubocop.yml

AllCops:
TargetRubyVersion: 2.6.5
TargetRubyVersion: 2.7.6
Exclude:
- 'vendor/bundle/**/*'
Lint/SuppressedException:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### Master (unreleased)

- [241](https://github.com/Shopify/job-iteration/pull/241) - Require Ruby 2.7+, dropping 2.6 support
- [241](https://github.com/Shopify/job-iteration/pull/241) - Require Rails 6.0+, dropping 5.2 support

## v1.3.6 (Mar 9, 2022)

- [190](https://github.com/Shopify/job-iteration/pull/190) - Fix updating `times_interrupted` and `total_time` when job is throttled
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PATH
remote: .
specs:
job-iteration (1.3.6)
activejob (>= 5.2)
activejob (>= 6.0)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ up:
- mysql-client:
or: [mysql@5.7]
- ruby:
version: 2.6.5
version: 2.7.6
- railgun
- bundler
- custom:
Expand Down
6 changes: 0 additions & 6 deletions gemfiles/rails_5_2.gemfile

This file was deleted.

4 changes: 2 additions & 2 deletions job-iteration.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "job-iteration/version"

Gem::Specification.new do |spec|
spec.required_ruby_version = ">= 2.6"
spec.required_ruby_version = ">= 2.7"
spec.name = "job-iteration"
spec.version = JobIteration::VERSION
spec.authors = ["Shopify"]
Expand All @@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
spec.metadata["allowed_push_host"] = "https://rubygems.org"

spec.add_development_dependency("activerecord")
spec.add_dependency("activejob", ">= 5.2")
spec.add_dependency("activejob", ">= 6.0")
end
9 changes: 1 addition & 8 deletions lib/job-iteration/csv_enumerator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,7 @@ def batches(batch_size:, cursor:)
private

def count_of_rows_in_file
# TODO: Remove rescue for NoMethodError when Ruby 2.6 is no longer supported.
begin
filepath = @csv.path
rescue NoMethodError
return
end

# Behaviour of CSV#path changed in Ruby 2.6.3 (returns nil instead of raising NoMethodError)
filepath = @csv.path
return unless filepath

count = %x(wc -l < #{filepath}).strip.to_i
Expand Down