diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 186063b77..96f12e287 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,6 +63,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + - name: Install missing libs (Temporary regression in GH Action?) + run: sudo apt update && sudo apt-get -yqq install build-essential ruby-dev - name: Update .ruby-version with matrix value run: echo "${{ matrix.ruby }}" >| .ruby-version diff --git a/.rubocop.yml b/.rubocop.yml index 20d908e5a..24ed3de17 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -99,6 +99,10 @@ Style/EmptyMethod: Style/FormatStringToken: EnforcedStyle: template +Style/FrozenStringLiteralComment: + Exclude: + - gemfiles/*.gemfile + Style/MultilineBlockChain: Enabled: false diff --git a/Appraisals b/Appraisals index 4ba8b57c9..214907d34 100644 --- a/Appraisals +++ b/Appraisals @@ -20,6 +20,11 @@ end if ruby_27_or_higher && !jruby # Rails HEAD requires MRI 2.7+ # activerecord-jdbcpostgresql-adapter does not have a compatible version + + appraise "rails-7.0" do + gem "rails", "~> 7.0.0.alpha" + end + appraise "rails-head" do gem "rails", github: "rails/rails", branch: "main" end diff --git a/Gemfile b/Gemfile index 8b42144f6..260562176 100644 --- a/Gemfile +++ b/Gemfile @@ -15,6 +15,7 @@ gemspec gem 'activerecord-jdbcpostgresql-adapter', platforms: [:jruby] gem 'appraisal', github: "bensheldon/appraisal", branch: "fix-bundle-env" # https://github.com/thoughtbot/appraisal/pull/174 gem 'pg', platforms: [:mri, :mingw, :x64_mingw] +gem 'puma', '5.4.0' gem 'rails' platforms :ruby do diff --git a/Gemfile.lock b/Gemfile.lock index a591ece2f..2385f881f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -130,8 +130,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - chef-utils (17.4.38) - concurrent-ruby + chef-utils (16.6.14) childprocess (3.0.0) coderay (1.1.3) concurrent-ruby (1.1.9) @@ -155,9 +154,9 @@ GEM rubocop smart_properties erubi (1.10.0) - et-orbi (1.2.4) + et-orbi (1.2.5) tzinfo - faraday (1.7.1) + faraday (1.8.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -178,11 +177,11 @@ GEM faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) - ffi (1.15.3) - ffi (1.15.3-java) + ffi (1.15.4) + ffi (1.15.4-java) fiber-local (1.0.0) foreman (0.87.2) - fugit (1.5.1) + fugit (1.5.2) et-orbi (~> 1.1, >= 1.1.8) raabro (~> 1.4) gem-release (2.2.2) @@ -210,7 +209,7 @@ GEM nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (1.0.1) + marcel (1.0.2) mdl (0.11.0) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.1) @@ -228,6 +227,7 @@ GEM mixlib-shellout (3.2.5) chef-utils msgpack (1.4.2) + msgpack (1.4.2-java) multi_json (1.15.0) multipart-post (2.1.1) nio4r (2.5.8) @@ -241,7 +241,7 @@ GEM faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) optimist (3.0.1) - parallel (1.20.1) + parallel (1.21.0) parser (3.0.2.0) ast (~> 2.4.1) pg (1.2.3) @@ -326,7 +326,7 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.10.2) - rubocop (1.20.0) + rubocop (1.21.0) parallel (~> 1.10) parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) @@ -340,7 +340,7 @@ GEM rubocop-performance (1.11.5) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.11.3) + rubocop-rails (2.12.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) @@ -357,7 +357,7 @@ GEM childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) sigdump (0.2.4) - smart_properties (1.16.0) + smart_properties (1.16.3) spoon (0.0.6) ffi sprockets (4.0.2) @@ -372,7 +372,7 @@ GEM tomlrb (2.0.1) tzinfo (2.0.4) concurrent-ruby (~> 1.0) - unicode-display_width (2.0.0) + unicode-display_width (2.1.0) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-driver (0.7.5-java) @@ -410,7 +410,7 @@ DEPENDENCIES pg pry-byebug pry-rails - puma + puma (= 5.4.0) rails rbtrace rspec-rails diff --git a/gemfiles/rails_5.2.gemfile b/gemfiles/rails_5.2.gemfile index 5e2d4786d..38562cf64 100644 --- a/gemfiles/rails_5.2.gemfile +++ b/gemfiles/rails_5.2.gemfile @@ -1,4 +1,3 @@ -# frozen_string_literal: true # This file was generated by Appraisal source "https://rubygems.org" @@ -6,6 +5,7 @@ source "https://rubygems.org" gem "activerecord-jdbcpostgresql-adapter", platforms: [:jruby] gem "appraisal", branch: "fix-bundle-env", git: "https://github.com/bensheldon/appraisal.git" gem "pg", platforms: [:mri, :mingw, :x64_mingw] +gem "puma", "5.4.0" gem "rails", "~> 5.2.0" platforms :ruby do diff --git a/gemfiles/rails_6.0.gemfile b/gemfiles/rails_6.0.gemfile index 3d1d9cf37..7d547816d 100644 --- a/gemfiles/rails_6.0.gemfile +++ b/gemfiles/rails_6.0.gemfile @@ -1,4 +1,3 @@ -# frozen_string_literal: true # This file was generated by Appraisal source "https://rubygems.org" @@ -6,6 +5,7 @@ source "https://rubygems.org" gem "activerecord-jdbcpostgresql-adapter", platforms: [:jruby] gem "appraisal", branch: "fix-bundle-env", git: "https://github.com/bensheldon/appraisal.git" gem "pg", platforms: [:mri, :mingw, :x64_mingw] +gem "puma", "5.4.0" gem "rails", "~> 6.0.0" platforms :ruby do diff --git a/gemfiles/rails_6.1.gemfile b/gemfiles/rails_6.1.gemfile index d2ee92b98..496166712 100644 --- a/gemfiles/rails_6.1.gemfile +++ b/gemfiles/rails_6.1.gemfile @@ -1,4 +1,3 @@ -# frozen_string_literal: true # This file was generated by Appraisal source "https://rubygems.org" @@ -6,6 +5,7 @@ source "https://rubygems.org" gem "activerecord-jdbcpostgresql-adapter", platforms: [:jruby] gem "appraisal", branch: "fix-bundle-env", git: "https://github.com/bensheldon/appraisal.git" gem "pg", platforms: [:mri, :mingw, :x64_mingw] +gem "puma", "5.4.0" gem "rails", "~> 6.1.0" platforms :ruby do diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile new file mode 100644 index 000000000..2dfcad498 --- /dev/null +++ b/gemfiles/rails_7.0.gemfile @@ -0,0 +1,27 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activerecord-jdbcpostgresql-adapter", platforms: [:jruby] +gem "appraisal", branch: "fix-bundle-env", git: "https://github.com/bensheldon/appraisal.git" +gem "pg", platforms: [:mri, :mingw, :x64_mingw] +gem "puma", "5.4.0" +gem "rails", "~> 7.0.0.alpha" + +platforms :ruby do + gem "activerecord-explain-analyze" + gem "memory_profiler" + gem "pry-byebug" + gem "rbtrace" + + group :lint do + gem "erb_lint", ">= 0.0.35" + gem "mdl" + gem "rubocop" + gem "rubocop-performance" + gem "rubocop-rails" + gem "rubocop-rspec" + end +end + +gemspec path: "../" diff --git a/gemfiles/rails_head.gemfile b/gemfiles/rails_head.gemfile index db94e34ec..386eca50a 100644 --- a/gemfiles/rails_head.gemfile +++ b/gemfiles/rails_head.gemfile @@ -1,4 +1,3 @@ -# frozen_string_literal: true # This file was generated by Appraisal source "https://rubygems.org" @@ -6,6 +5,7 @@ source "https://rubygems.org" gem "activerecord-jdbcpostgresql-adapter", platforms: [:jruby] gem "appraisal", branch: "fix-bundle-env", git: "https://github.com/bensheldon/appraisal.git" gem "pg", platforms: [:mri, :mingw, :x64_mingw] +gem "puma", "5.4.0" gem "rails", branch: "main", git: "https://github.com/rails/rails.git" platforms :ruby do diff --git a/lib/good_job/adapter.rb b/lib/good_job/adapter.rb index 9217deb6c..230059b26 100644 --- a/lib/good_job/adapter.rb +++ b/lib/good_job/adapter.rb @@ -101,14 +101,14 @@ def shutdown(timeout: :default) # @return [Boolean] def execute_async? @configuration.execution_mode == :async_all || - @configuration.execution_mode.in?([:async, :async_server]) && in_server_process? + (@configuration.execution_mode.in?([:async, :async_server]) && in_server_process?) end # Whether in +:external+ execution mode. # @return [Boolean] def execute_externally? @configuration.execution_mode == :external || - @configuration.execution_mode.in?([:async, :async_server]) && !in_server_process? + (@configuration.execution_mode.in?([:async, :async_server]) && !in_server_process?) end # Whether in +:inline+ execution mode.