Skip to content

Commit

Permalink
2.0: Upgrade Ruby and Rails minimum version
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed May 18, 2023
1 parent 29f0558 commit 66a4ff5
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1"]
ruby: ["2.7", "3.0", "3.1", "3.2"]
runs-on: ubuntu-latest
services:
faktory:
Expand Down
2 changes: 1 addition & 1 deletion .standard.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ruby_version: 2.5.0
ruby_version: 2.7.0
fix: true
parallel: true
ignore:
Expand Down
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes

## HEAD

- Minimum Ruby version is now 2.7.0.
- Minimum Rails version is now 6.0.0.

## 1.3.0

- Fix `faktory/testing` [#74]
Expand Down
28 changes: 18 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
faktory_worker_ruby (1.3.0)
faktory_worker_ruby (2.0.0)
connection_pool (~> 2.2, >= 2.2.2)

GEM
Expand All @@ -21,31 +21,32 @@ GEM
docile (1.4.0)
globalid (1.1.0)
activesupport (>= 5.0)
i18n (1.12.0)
i18n (1.13.0)
concurrent-ruby (~> 1.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
lint_roller (1.0.0)
minitest (5.18.0)
minitest-hooks (1.5.0)
minitest (> 5.3)
parallel (1.22.1)
parser (3.2.2.0)
parallel (1.23.0)
parser (3.2.2.1)
ast (~> 2.4.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.7.0)
regexp_parser (2.8.0)
rexml (3.2.5)
rubocop (1.48.1)
rubocop (1.50.2)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.26.0, < 2.0)
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
rubocop-ast (1.28.1)
parser (>= 3.2.1.0)
rubocop-performance (1.16.0)
rubocop (>= 1.7.0, < 2.0)
Expand All @@ -57,9 +58,16 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
standard (1.25.3)
standard (1.28.2)
language_server-protocol (~> 3.17.0.2)
rubocop (~> 1.48.1)
lint_roller (~> 1.0)
rubocop (~> 1.50.2)
standard-custom (~> 1.0.0)
standard-performance (~> 1.0.1)
standard-custom (1.0.0)
lint_roller (~> 1.0)
standard-performance (1.0.1)
lint_roller (~> 1.0)
rubocop-performance (~> 1.16.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand Down
4 changes: 2 additions & 2 deletions faktory_worker_ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
gem.executables = ["faktory-worker"]
gem.files = `git ls-files | grep -Ev '^(test|myapp|examples)'`.split("\n")
gem.version = Faktory::VERSION
gem.required_ruby_version = ">= 2.5.0"
gem.required_ruby_version = ">= 2.7.0"

gem.metadata = {
"homepage_uri" => "https://contribsys.com/faktory",
Expand All @@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
}

gem.add_dependency "connection_pool", "~> 2.2", ">= 2.2.2"
gem.add_development_dependency "activejob", ">= 5.2.0"
gem.add_development_dependency "activejob", ">= 6.0.0"
gem.add_development_dependency "minitest", "~> 5"
gem.add_development_dependency "minitest-hooks"
gem.add_development_dependency "rake"
Expand Down
6 changes: 3 additions & 3 deletions lib/faktory/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ def result
raise Errno::ECONNRESET, "No response" unless line
chr = line[0]
if chr == "+"
line[1..-1].strip
line[1..].strip
elsif chr == "$"
count = line[1..-1].strip.to_i
count = line[1..].strip.to_i
return nil if count == -1
data = read(count) if count > 0
_ = gets # read extra linefeeds
Expand All @@ -362,7 +362,7 @@ def result
#
# -NOTUNIQUE Job not unique
# We return ["NOTUNIQUE", "Job not unique"]
err = line[1..-1].split(" ", 2)
err = line[1..].split(" ", 2)
raise CommandError, err[1] if err[0] == "ERR"
err
else
Expand Down
6 changes: 3 additions & 3 deletions lib/faktory/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Rails < ::Rails::Engine
# None of this matters on the client-side, only within the Faktory executor itself.
#
Faktory.configure_worker do |_|
if ::Rails::VERSION::MAJOR < 5
if ::Rails::VERSION::MAJOR < 6
raise "Your current version of Rails, #{::Rails::VERSION::STRING}, is not supported"
end

Expand Down Expand Up @@ -58,9 +58,9 @@ def inspect
end
end

if defined?(::Rails) && ::Rails::VERSION::MAJOR < 5
if defined?(::Rails) && ::Rails::VERSION::MAJOR < 6
warn("**************************************************")
warn("🚫 ERROR: Faktory Worker does not support Rails versions under 5.x - please ensure your workers are updated")
warn("🚫 ERROR: Faktory Worker does not support Rails version < 6.x")
warn("**************************************************")
warn("")
end
Expand Down
2 changes: 1 addition & 1 deletion lib/faktory/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Faktory
VERSION = "1.3.0"
VERSION = "2.0.0"
end

0 comments on commit 66a4ff5

Please sign in to comment.