diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 539440e..48500e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,12 +15,13 @@ jobs: ruby: ['3.2'] gemfile: - gemfiles/rails_7_0.gemfile + - gemfiles/rails_7_1.gemfile services: postgres: image: postgres env: POSTGRES_USER: runner - POSTGRES_PASSWORD: postgres + POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_DB: with_transactional_lock_test DB_ADAPTER: postgresql # Set health checks to wait until postgres has started @@ -43,7 +44,7 @@ jobs: options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} diff --git a/Appraisals b/Appraisals index cae1445..2e65081 100644 --- a/Appraisals +++ b/Appraisals @@ -3,3 +3,7 @@ appraise 'rails-7-0' do gem 'rails', '~> 7.0.0' end + +appraise 'rails-7-1' do + gem 'rails', '~> 7.1.0' +end diff --git a/Gemfile.lock b/Gemfile.lock index 1db78ce..5230e9b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ PATH remote: . specs: - with_transactional_lock (2.1.0) - rails (>= 6.1, < 7.1) + with_transactional_lock (2.2.0) + rails (>= 7.0, < 7.2) GEM remote: https://rubygems.org/ @@ -72,14 +72,11 @@ GEM i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) appraisal (2.2.0) bundler rake thor (>= 0.14.0) ast (2.4.2) - backports (3.24.1) betterlint (1.7.0) rubocop (> 1.0) rubocop-performance @@ -88,7 +85,6 @@ GEM rubocop-rspec (>= 2.24) builder (3.2.4) concurrent-ruby (1.2.2) - connection_pool (2.4.1) crass (1.0.6) database_cleaner (2.0.2) database_cleaner-active_record (>= 2, < 3) @@ -99,29 +95,12 @@ GEM date (3.3.4) diff-lcs (1.5.0) erubi (1.12.0) - ethon (0.16.0) - ffi (>= 1.15.0) - faraday (0.17.6) - multipart-post (>= 1.2, < 3) - faraday_middleware (0.14.0) - faraday (>= 0.7.4, < 1.0) - ffi (1.16.3) - gh (0.14.0) - addressable - backports - faraday (~> 0.8) - multi_json (~> 1.0) - net-http-persistent (>= 2.7) - net-http-pipeline globalid (1.2.1) activesupport (>= 6.1) - highline (1.7.10) i18n (1.14.1) concurrent-ruby (~> 1.0) json (2.7.1) language_server-protocol (3.17.0.3) - launchy (2.5.2) - addressable (~> 2.8) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -137,12 +116,7 @@ GEM mime-types-data (3.2023.1205) mini_mime (1.1.5) minitest (5.20.0) - multi_json (1.15.0) - multipart-post (2.3.0) mysql2 (0.5.5) - net-http-persistent (4.0.2) - connection_pool (~> 2.2) - net-http-pipeline (1.0.1) net-imap (0.4.9) date net-protocol @@ -164,10 +138,6 @@ GEM ast (~> 2.4.1) racc pg (1.5.4) - public_suffix (5.0.4) - pusher-client (0.6.2) - json - websocket (~> 1.0) racc (1.7.3) rack (2.2.8.1) rack-test (2.1.0) @@ -260,21 +230,9 @@ GEM rack (> 1, < 3) thor (1.3.0) timeout (0.4.1) - travis (1.8.13) - backports - faraday (~> 0.9) - faraday_middleware (~> 0.9, >= 0.9.1) - gh (~> 0.13) - highline (~> 1.6) - launchy (~> 2.1) - pusher-client (~> 0.4) - typhoeus (~> 0.6, >= 0.6.8) - typhoeus (0.8.0) - ethon (>= 0.8.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -295,7 +253,6 @@ DEPENDENCIES rspec-rails (~> 3.1) rspec-retry sprockets (~> 3.0) - travis with_transactional_lock! BUNDLED WITH diff --git a/Rakefile b/Rakefile index 8ab3d35..5e7765b 100644 --- a/Rakefile +++ b/Rakefile @@ -32,6 +32,7 @@ if (Rails.env.development? || Rails.env.test?) && defined? Dummy task(:default).clear if ENV['APPRAISAL_INITIALIZED'] || ENV['CI'] + tasks = [:spec] tasks += [:rubocop] unless ENV['CI'] task default: tasks # rubocop:disable Rake/DuplicateTask diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index a746062..bee46ce 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -1,8 +1,8 @@ PATH remote: .. specs: - with_transactional_lock (2.1.0) - rails (>= 6.1, < 7.1) + with_transactional_lock (2.2.0) + rails (>= 7.0, < 7.2) GEM remote: https://rubygems.org/ @@ -72,14 +72,11 @@ GEM i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) appraisal (2.2.0) bundler rake thor (>= 0.14.0) ast (2.4.2) - backports (3.24.1) betterlint (1.7.0) rubocop (> 1.0) rubocop-performance @@ -88,7 +85,6 @@ GEM rubocop-rspec (>= 2.24) builder (3.2.4) concurrent-ruby (1.2.2) - connection_pool (2.4.1) crass (1.0.6) database_cleaner (2.0.2) database_cleaner-active_record (>= 2, < 3) @@ -99,29 +95,12 @@ GEM date (3.3.4) diff-lcs (1.5.0) erubi (1.12.0) - ethon (0.16.0) - ffi (>= 1.15.0) - faraday (0.17.6) - multipart-post (>= 1.2, < 3) - faraday_middleware (0.14.0) - faraday (>= 0.7.4, < 1.0) - ffi (1.16.3) - gh (0.14.0) - addressable - backports - faraday (~> 0.8) - multi_json (~> 1.0) - net-http-persistent (>= 2.7) - net-http-pipeline globalid (1.2.1) activesupport (>= 6.1) - highline (1.7.10) i18n (1.14.1) concurrent-ruby (~> 1.0) json (2.7.1) language_server-protocol (3.17.0.3) - launchy (2.5.2) - addressable (~> 2.8) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -137,12 +116,7 @@ GEM mime-types-data (3.2023.1205) mini_mime (1.1.5) minitest (5.20.0) - multi_json (1.15.0) - multipart-post (2.3.0) mysql2 (0.5.5) - net-http-persistent (4.0.2) - connection_pool (~> 2.2) - net-http-pipeline (1.0.1) net-imap (0.4.9) date net-protocol @@ -153,17 +127,17 @@ GEM net-smtp (0.4.0) net-protocol nio4r (2.7.0) + nokogiri (1.16.0-arm64-darwin) + racc (~> 1.4) nokogiri (1.16.0-x86_64-darwin) racc (~> 1.4) + nokogiri (1.16.0-x86_64-linux) + racc (~> 1.4) parallel (1.24.0) parser (3.2.2.4) ast (~> 2.4.1) racc pg (1.5.4) - public_suffix (5.0.4) - pusher-client (0.6.2) - json - websocket (~> 1.0) racc (1.7.3) rack (2.2.8) rack-test (2.1.0) @@ -256,27 +230,16 @@ GEM rack (> 1, < 3) thor (1.3.0) timeout (0.4.1) - travis (1.8.13) - backports - faraday (~> 0.9) - faraday_middleware (~> 0.9, >= 0.9.1) - gh (~> 0.13) - highline (~> 1.6) - launchy (~> 2.1) - pusher-client (~> 0.4) - typhoeus (~> 0.6, >= 0.6.8) - typhoeus (0.8.0) - ethon (>= 0.8.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) zeitwerk (2.6.12) PLATFORMS + arm64-darwin-22 x86_64-darwin-22 x86_64-linux @@ -291,7 +254,6 @@ DEPENDENCIES rspec-rails (~> 3.1) rspec-retry sprockets (~> 3.0) - travis with_transactional_lock! BUNDLED WITH diff --git a/gemfiles/rails_7_1.gemfile b/gemfiles/rails_7_1.gemfile new file mode 100644 index 0000000..2470682 --- /dev/null +++ b/gemfiles/rails_7_1.gemfile @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "~> 7.1.0" + +gemspec path: "../" diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock new file mode 100644 index 0000000..5a8cdab --- /dev/null +++ b/gemfiles/rails_7_1.gemfile.lock @@ -0,0 +1,288 @@ +PATH + remote: .. + specs: + with_transactional_lock (2.2.0) + rails (>= 7.0, < 7.2) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.1.3.2) + actionpack (= 7.1.3.2) + activesupport (= 7.1.3.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.3.2) + actionpack (= 7.1.3.2) + activejob (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.3.2) + actionpack (= 7.1.3.2) + actionview (= 7.1.3.2) + activejob (= 7.1.3.2) + activesupport (= 7.1.3.2) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.3.2) + actionview (= 7.1.3.2) + activesupport (= 7.1.3.2) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3.2) + actionpack (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.1.3.2) + activesupport (= 7.1.3.2) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3.2) + activesupport (= 7.1.3.2) + globalid (>= 0.3.6) + activemodel (7.1.3.2) + activesupport (= 7.1.3.2) + activerecord (7.1.3.2) + activemodel (= 7.1.3.2) + activesupport (= 7.1.3.2) + timeout (>= 0.4.0) + activestorage (7.1.3.2) + actionpack (= 7.1.3.2) + activejob (= 7.1.3.2) + activerecord (= 7.1.3.2) + activesupport (= 7.1.3.2) + marcel (~> 1.0) + activesupport (7.1.3.2) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + appraisal (2.2.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + base64 (0.2.0) + betterlint (1.7.0) + rubocop (> 1.0) + rubocop-performance + rubocop-rails + rubocop-rake + rubocop-rspec (>= 2.24) + bigdecimal (3.1.7) + builder (3.2.4) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) + crass (1.0.6) + database_cleaner (2.0.2) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.1.0) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) + date (3.3.4) + diff-lcs (1.5.1) + drb (2.2.1) + erubi (1.12.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.4) + concurrent-ruby (~> 1.0) + io-console (0.7.2) + irb (1.12.0) + rdoc + reline (>= 0.4.2) + json (2.7.1) + language_server-protocol (3.17.0.3) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + mime-types (3.5.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2024.0305) + mini_mime (1.1.5) + minitest (5.22.3) + mutex_m (0.2.0) + mysql2 (0.5.6) + net-imap (0.4.10) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.4.0.1) + net-protocol + nio4r (2.7.0) + nokogiri (1.16.3-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.3-x86_64-linux) + racc (~> 1.4) + parallel (1.24.0) + parser (3.3.0.5) + ast (~> 2.4.1) + racc + pg (1.5.6) + psych (5.1.2) + stringio + racc (1.7.3) + rack (2.2.8.1) + rack-session (1.0.2) + rack (< 3) + rack-test (2.1.0) + rack (>= 1.3) + rackup (1.0.0) + rack (< 3) + webrick + rails (7.1.3.2) + actioncable (= 7.1.3.2) + actionmailbox (= 7.1.3.2) + actionmailer (= 7.1.3.2) + actionpack (= 7.1.3.2) + actiontext (= 7.1.3.2) + actionview (= 7.1.3.2) + activejob (= 7.1.3.2) + activemodel (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) + bundler (>= 1.15.0) + railties (= 7.1.3.2) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.3.2) + actionpack (= 7.1.3.2) + activesupport (= 7.1.3.2) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.1.0) + rdoc (6.6.2) + psych (>= 4.0.0) + regexp_parser (2.9.0) + reline (0.4.3) + io-console (~> 0.5) + rexml (3.2.6) + rspec-core (3.9.3) + rspec-support (~> 3.9.3) + rspec-expectations (3.9.4) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-mocks (3.9.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-rails (3.9.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.9.0) + rspec-expectations (~> 3.9.0) + rspec-mocks (~> 3.9.0) + rspec-support (~> 3.9.0) + rspec-retry (0.6.2) + rspec-core (> 3.3) + rspec-support (3.9.4) + rubocop (1.62.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.25.1) + rubocop (~> 1.41) + rubocop-performance (1.20.2) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rails (2.24.0) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.27.1) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + stringio (3.1.0) + thor (1.3.1) + timeout (0.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + webrick (1.8.1) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.6.13) + +PLATFORMS + arm64-darwin-22 + x86_64-linux + +DEPENDENCIES + appraisal (~> 2.2.0) + betterlint + database_cleaner + mime-types + mysql2 + pg + rails (~> 7.1.0) + rspec-rails (~> 3.1) + rspec-retry + sprockets (~> 3.0) + with_transactional_lock! + +BUNDLED WITH + 2.4.22 diff --git a/lib/tasks/with_transactional_lock_tasks.rake b/lib/tasks/with_transactional_lock_tasks.rake index e3fc382..f3ee757 100644 --- a/lib/tasks/with_transactional_lock_tasks.rake +++ b/lib/tasks/with_transactional_lock_tasks.rake @@ -1,4 +1,5 @@ # frozen_string_literal: true + # desc "Explaining what the task does" # task :with_transactional_lock do # # Task goes here diff --git a/lib/with_transactional_lock/version.rb b/lib/with_transactional_lock/version.rb index add4b7e..a9b7a6b 100644 --- a/lib/with_transactional_lock/version.rb +++ b/lib/with_transactional_lock/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module WithTransactionalLock - VERSION = "2.1.0" + VERSION = "2.2.0" end diff --git a/spec/dummy/config/database.yml b/spec/dummy/config/database.yml index 88c5e29..bcc4ce6 100644 --- a/spec/dummy/config/database.yml +++ b/spec/dummy/config/database.yml @@ -10,6 +10,8 @@ postgresql: test: &pg_test <<: *default adapter: 'postgresql' + username: <%= ENV['POSTGRES_USER'] %> + host: localhost database: 'with_transactional_lock_test' mysql: diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb index b67a201..761ad2d 100644 --- a/spec/dummy/config/environments/development.rb +++ b/spec/dummy/config/environments/development.rb @@ -27,16 +27,16 @@ # Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. - config.assets.debug = true + # config.assets.debug = true # Asset digests allow you to set far-future HTTP expiration dates on all assets, # yet still be able to expire them through the digest params. - config.assets.digest = true + # config.assets.digest = true # Adds additional error checking when serving assets at runtime. # Checks for improperly declared sprockets dependencies. # Raises helpful error messages. - config.assets.raise_runtime_errors = true + # config.assets.raise_runtime_errors = true # Raises error for missing translations # config.action_view.raise_on_missing_translations = true diff --git a/spec/dummy/config/environments/production.rb b/spec/dummy/config/environments/production.rb index 254b7c2..f91115a 100644 --- a/spec/dummy/config/environments/production.rb +++ b/spec/dummy/config/environments/production.rb @@ -27,15 +27,15 @@ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier + # config.assets.js_compressor = :uglifier # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false + # config.assets.compile = false # Asset digests allow you to set far-future HTTP expiration dates on all assets, # yet still be able to expire them through the digest params. - config.assets.digest = true + # config.assets.digest = true # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb diff --git a/spec/dummy/config/initializers/backtrace_silencers.rb b/spec/dummy/config/initializers/backtrace_silencers.rb index d0f0d3b..4b63f28 100644 --- a/spec/dummy/config/initializers/backtrace_silencers.rb +++ b/spec/dummy/config/initializers/backtrace_silencers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/spec/dummy/config/initializers/inflections.rb b/spec/dummy/config/initializers/inflections.rb index aa7435f..dc84742 100644 --- a/spec/dummy/config/initializers/inflections.rb +++ b/spec/dummy/config/initializers/inflections.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/spec/dummy/config/initializers/mime_types.rb b/spec/dummy/config/initializers/mime_types.rb index 6e1d16f..be6fedc 100644 --- a/spec/dummy/config/initializers/mime_types.rb +++ b/spec/dummy/config/initializers/mime_types.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/with_transactional_lock.gemspec b/with_transactional_lock.gemspec index dd77069..0baf9bb 100644 --- a/with_transactional_lock.gemspec +++ b/with_transactional_lock.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |s| s.files = Dir["lib/**/*", "LICENSE", "Rakefile", "README.md"] - s.add_dependency "rails", ">= 6.1", "< 7.1" + s.add_dependency "rails", ">= 7.0", "< 7.2" s.add_development_dependency 'appraisal', '~> 2.2.0' s.add_development_dependency 'betterlint' @@ -31,7 +31,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'rspec-rails', '~> 3.1' s.add_development_dependency 'rspec-retry' s.add_development_dependency 'sprockets', '~> 3.0' - s.add_development_dependency 'travis' s.required_ruby_version = '>= 3.2' end