diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e674f15..967b016 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.standard.yml b/.standard.yml index c9ff7af..7f86c05 100644 --- a/.standard.yml +++ b/.standard.yml @@ -1,4 +1,4 @@ -ruby_version: 2.5.0 +ruby_version: 2.7.0 fix: true parallel: true ignore: diff --git a/Changes.md b/Changes.md index eb6bd0a..fad5ed0 100644 --- a/Changes.md +++ b/Changes.md @@ -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] diff --git a/Gemfile.lock b/Gemfile.lock index ddc78d8..4bdcc29 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 @@ -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) @@ -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) diff --git a/faktory_worker_ruby.gemspec b/faktory_worker_ruby.gemspec index 7d1b65e..cad8573 100644 --- a/faktory_worker_ruby.gemspec +++ b/faktory_worker_ruby.gemspec @@ -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", @@ -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" diff --git a/lib/faktory/client.rb b/lib/faktory/client.rb index 0d0b248..8850766 100644 --- a/lib/faktory/client.rb +++ b/lib/faktory/client.rb @@ -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 @@ -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 diff --git a/lib/faktory/rails.rb b/lib/faktory/rails.rb index 6a28943..b388ec1 100644 --- a/lib/faktory/rails.rb +++ b/lib/faktory/rails.rb @@ -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 @@ -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 diff --git a/lib/faktory/version.rb b/lib/faktory/version.rb index 756ba55..bd9536b 100644 --- a/lib/faktory/version.rb +++ b/lib/faktory/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Faktory - VERSION = "1.3.0" + VERSION = "2.0.0" end