From ca6252dd402cf5d97cab3f2f64637b0632c5ff1e Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:20:36 -0500 Subject: [PATCH 01/15] Remove rails as a dependency --- Gemfile.lock | 83 +-------------------------------- with_transactional_lock.gemspec | 3 +- 2 files changed, 4 insertions(+), 82 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9fa0d59..3e402bb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,36 +2,12 @@ PATH remote: . specs: with_transactional_lock (2.2.0) - rails (>= 7.0, < 7.2) + activerecord (>= 7.0, < 7.2) + railties (>= 7.0, < 7.2) GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.5) - actionpack (= 7.0.8.5) - activesupport (= 7.0.8.5) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.5) - actionpack (= 7.0.8.5) - activejob (= 7.0.8.5) - activerecord (= 7.0.8.5) - activestorage (= 7.0.8.5) - activesupport (= 7.0.8.5) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.8.5) - actionpack (= 7.0.8.5) - actionview (= 7.0.8.5) - activejob (= 7.0.8.5) - activesupport (= 7.0.8.5) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) actionpack (7.0.8.5) actionview (= 7.0.8.5) activesupport (= 7.0.8.5) @@ -39,34 +15,17 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.5) - actionpack (= 7.0.8.5) - activerecord (= 7.0.8.5) - activestorage (= 7.0.8.5) - activesupport (= 7.0.8.5) - globalid (>= 0.6.0) - nokogiri (>= 1.8.5) actionview (7.0.8.5) activesupport (= 7.0.8.5) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8.5) - activesupport (= 7.0.8.5) - globalid (>= 0.3.6) activemodel (7.0.8.5) activesupport (= 7.0.8.5) activerecord (7.0.8.5) activemodel (= 7.0.8.5) activesupport (= 7.0.8.5) - activestorage (7.0.8.5) - actionpack (= 7.0.8.5) - activejob (= 7.0.8.5) - activerecord (= 7.0.8.5) - activesupport (= 7.0.8.5) - marcel (~> 1.0) - mini_mime (>= 1.1.0) activesupport (7.0.8.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) @@ -92,11 +51,8 @@ GEM activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - date (3.3.4) diff-lcs (1.5.0) erubi (1.13.0) - globalid (1.2.1) - activesupport (>= 6.1) i18n (1.14.6) concurrent-ruby (~> 1.0) json (2.7.1) @@ -104,29 +60,12 @@ GEM 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) method_source (1.0.0) mime-types (3.5.1) mime-types-data (~> 3.2015) mime-types-data (3.2023.1205) - mini_mime (1.1.5) minitest (5.25.1) mysql2 (0.5.5) - net-imap (0.4.9) - date - net-protocol - net-pop (0.1.2) - net-protocol - net-protocol (0.2.2) - timeout - net-smtp (0.4.0) - net-protocol - nio4r (2.7.0) nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) nokogiri (1.16.7-x86_64-darwin) @@ -142,20 +81,6 @@ GEM rack (2.2.10) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8.5) - actioncable (= 7.0.8.5) - actionmailbox (= 7.0.8.5) - actionmailer (= 7.0.8.5) - actionpack (= 7.0.8.5) - actiontext (= 7.0.8.5) - actionview (= 7.0.8.5) - activejob (= 7.0.8.5) - activemodel (= 7.0.8.5) - activerecord (= 7.0.8.5) - activestorage (= 7.0.8.5) - activesupport (= 7.0.8.5) - bundler (>= 1.15.0) - railties (= 7.0.8.5) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -231,13 +156,9 @@ GEM rack (> 1, < 3) strscan (3.1.0) thor (1.3.0) - timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - websocket-driver (0.7.6) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) zeitwerk (2.6.12) PLATFORMS diff --git a/with_transactional_lock.gemspec b/with_transactional_lock.gemspec index 7f63b77..4dc3754 100644 --- a/with_transactional_lock.gemspec +++ b/with_transactional_lock.gemspec @@ -20,7 +20,8 @@ Gem::Specification.new do |s| s.files = Dir["lib/**/*", "LICENSE", "Rakefile", "README.md"] - s.add_dependency "rails", ">= 7.0", "< 7.2" + s.add_dependency 'activerecord', '>= 7.0', '< 7.2' + s.add_dependency 'railties', '>= 7.0', '< 7.2' s.add_development_dependency 'appraisal', '~> 2.2.0' s.add_development_dependency 'betterlint' From b24203351907e013bfa81d1e4b9cc082646f5cf4 Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:23:35 -0500 Subject: [PATCH 02/15] Fix specs --- spec/dummy/config/application.rb | 3 --- spec/dummy/config/environments/development.rb | 2 +- spec/dummy/config/environments/test.rb | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 069e21c..a9becd1 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -4,9 +4,6 @@ # Pick the frameworks you want: require "active_record/railtie" -require "action_controller/railtie" -require "action_mailer/railtie" -require "action_view/railtie" # require "rails/test_unit/railtie" Bundler.require(*Rails.groups) diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb index 761ad2d..4fbd064 100644 --- a/spec/dummy/config/environments/development.rb +++ b/spec/dummy/config/environments/development.rb @@ -16,7 +16,7 @@ config.action_controller.perform_caching = false # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false + # config.action_mailer.raise_delivery_errors = false # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb index f29f2e7..8ea5737 100644 --- a/spec/dummy/config/environments/test.rb +++ b/spec/dummy/config/environments/test.rb @@ -27,7 +27,7 @@ # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test + # config.action_mailer.delivery_method = :test # Randomize the order test cases are executed. config.active_support.test_order = :random From 67334c81911f0500665544f35c786128c58ebc14 Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:28:07 -0500 Subject: [PATCH 03/15] Remove trash from the dummy --- spec/dummy/README.rdoc | 28 ------- spec/dummy/Rakefile | 5 +- spec/dummy/app/assets/images/.keep | 0 .../app/assets/javascripts/application.js | 13 --- .../app/assets/stylesheets/application.css | 15 ---- .../app/controllers/application_controller.rb | 7 -- spec/dummy/app/controllers/concerns/.keep | 0 spec/dummy/app/helpers/application_helper.rb | 4 - spec/dummy/app/mailers/.keep | 0 spec/dummy/app/models/.keep | 0 spec/dummy/app/models/concerns/.keep | 0 .../app/views/layouts/application.html.erb | 14 ---- spec/dummy/bin/bundle | 5 -- spec/dummy/bin/rails | 6 -- spec/dummy/bin/rake | 6 -- spec/dummy/bin/setup | 31 ------- spec/dummy/config.ru | 6 -- spec/dummy/config/application.rb | 26 ++---- spec/dummy/config/boot.rb | 7 -- spec/dummy/config/environment.rb | 4 +- spec/dummy/config/environments/development.rb | 43 ---------- spec/dummy/config/environments/production.rb | 81 ------------------- spec/dummy/config/environments/test.rb | 40 --------- .../initializers/backtrace_silencers.rb | 9 --- .../config/initializers/cookies_serializer.rb | 5 -- .../initializers/filter_parameter_logging.rb | 6 -- spec/dummy/config/initializers/inflections.rb | 18 ----- spec/dummy/config/initializers/mime_types.rb | 6 -- .../config/initializers/session_store.rb | 5 -- .../config/initializers/wrap_parameters.rb | 16 ---- spec/dummy/config/locales/en.yml | 23 ------ spec/dummy/config/routes.rb | 58 ------------- spec/dummy/config/secrets.yml | 22 ----- spec/dummy/lib/assets/.keep | 0 spec/dummy/log/.keep | 0 spec/dummy/public/404.html | 67 --------------- spec/dummy/public/422.html | 67 --------------- spec/dummy/public/500.html | 66 --------------- spec/dummy/public/favicon.ico | 0 spec/spec_helper.rb | 2 +- 40 files changed, 11 insertions(+), 700 deletions(-) delete mode 100644 spec/dummy/README.rdoc delete mode 100644 spec/dummy/app/assets/images/.keep delete mode 100644 spec/dummy/app/assets/javascripts/application.js delete mode 100644 spec/dummy/app/assets/stylesheets/application.css delete mode 100644 spec/dummy/app/controllers/application_controller.rb delete mode 100644 spec/dummy/app/controllers/concerns/.keep delete mode 100644 spec/dummy/app/helpers/application_helper.rb delete mode 100644 spec/dummy/app/mailers/.keep delete mode 100644 spec/dummy/app/models/.keep delete mode 100644 spec/dummy/app/models/concerns/.keep delete mode 100644 spec/dummy/app/views/layouts/application.html.erb delete mode 100755 spec/dummy/bin/bundle delete mode 100755 spec/dummy/bin/rails delete mode 100755 spec/dummy/bin/rake delete mode 100755 spec/dummy/bin/setup delete mode 100644 spec/dummy/config.ru delete mode 100644 spec/dummy/config/boot.rb delete mode 100644 spec/dummy/config/environments/development.rb delete mode 100644 spec/dummy/config/environments/production.rb delete mode 100644 spec/dummy/config/environments/test.rb delete mode 100644 spec/dummy/config/initializers/backtrace_silencers.rb delete mode 100644 spec/dummy/config/initializers/cookies_serializer.rb delete mode 100644 spec/dummy/config/initializers/filter_parameter_logging.rb delete mode 100644 spec/dummy/config/initializers/inflections.rb delete mode 100644 spec/dummy/config/initializers/mime_types.rb delete mode 100644 spec/dummy/config/initializers/session_store.rb delete mode 100644 spec/dummy/config/initializers/wrap_parameters.rb delete mode 100644 spec/dummy/config/locales/en.yml delete mode 100644 spec/dummy/config/routes.rb delete mode 100644 spec/dummy/config/secrets.yml delete mode 100644 spec/dummy/lib/assets/.keep delete mode 100644 spec/dummy/log/.keep delete mode 100644 spec/dummy/public/404.html delete mode 100644 spec/dummy/public/422.html delete mode 100644 spec/dummy/public/500.html delete mode 100644 spec/dummy/public/favicon.ico diff --git a/spec/dummy/README.rdoc b/spec/dummy/README.rdoc deleted file mode 100644 index dd4e97e..0000000 --- a/spec/dummy/README.rdoc +++ /dev/null @@ -1,28 +0,0 @@ -== README - -This README would normally document whatever steps are necessary to get the -application up and running. - -Things you may want to cover: - -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... - - -Please feel free to use a different markup language if you do not plan to run -rake doc:app. diff --git a/spec/dummy/Rakefile b/spec/dummy/Rakefile index e51cf0e..6d1041e 100644 --- a/spec/dummy/Rakefile +++ b/spec/dummy/Rakefile @@ -1,8 +1,5 @@ # frozen_string_literal: true -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require File.expand_path('config/application', __dir__) +require_relative 'config/application' Rails.application.load_tasks diff --git a/spec/dummy/app/assets/images/.keep b/spec/dummy/app/assets/images/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/app/assets/javascripts/application.js b/spec/dummy/app/assets/javascripts/application.js deleted file mode 100644 index 8913b40..0000000 --- a/spec/dummy/app/assets/javascripts/application.js +++ /dev/null @@ -1,13 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. -// -// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require_tree . diff --git a/spec/dummy/app/assets/stylesheets/application.css b/spec/dummy/app/assets/stylesheets/application.css deleted file mode 100644 index f9cd5b3..0000000 --- a/spec/dummy/app/assets/stylesheets/application.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any styles - * defined in the other CSS/SCSS files in this directory. It is generally better to create a new - * file per style scope. - * - *= require_tree . - *= require_self - */ diff --git a/spec/dummy/app/controllers/application_controller.rb b/spec/dummy/app/controllers/application_controller.rb deleted file mode 100644 index 1ff0944..0000000 --- a/spec/dummy/app/controllers/application_controller.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception -end diff --git a/spec/dummy/app/controllers/concerns/.keep b/spec/dummy/app/controllers/concerns/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/app/helpers/application_helper.rb b/spec/dummy/app/helpers/application_helper.rb deleted file mode 100644 index 15b06f0..0000000 --- a/spec/dummy/app/helpers/application_helper.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -module ApplicationHelper -end diff --git a/spec/dummy/app/mailers/.keep b/spec/dummy/app/mailers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/app/models/.keep b/spec/dummy/app/models/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/app/models/concerns/.keep b/spec/dummy/app/models/concerns/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/app/views/layouts/application.html.erb b/spec/dummy/app/views/layouts/application.html.erb deleted file mode 100644 index 593a778..0000000 --- a/spec/dummy/app/views/layouts/application.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - - - - Dummy - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> - <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - - diff --git a/spec/dummy/bin/bundle b/spec/dummy/bin/bundle deleted file mode 100755 index 2dbb717..0000000 --- a/spec/dummy/bin/bundle +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) -load Gem.bin_path('bundler', 'bundle') diff --git a/spec/dummy/bin/rails b/spec/dummy/bin/rails deleted file mode 100755 index a31728a..0000000 --- a/spec/dummy/bin/rails +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -APP_PATH = File.expand_path('../config/application', __dir__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/spec/dummy/bin/rake b/spec/dummy/bin/rake deleted file mode 100755 index c199955..0000000 --- a/spec/dummy/bin/rake +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/spec/dummy/bin/setup b/spec/dummy/bin/setup deleted file mode 100755 index 2f2a12f..0000000 --- a/spec/dummy/bin/setup +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require 'pathname' - -# path to your application root. -APP_ROOT = Pathname.new File.expand_path('..', __dir__) - -Dir.chdir APP_ROOT do - # This script is a starting point to setup your application. - # Add necessary setup steps to this file: - - puts "== Installing dependencies ==" - system "gem install bundler --conservative" - system "bundle check || bundle install" - - # puts "\n== Copying sample files ==" - # unless File.exist?("config/database.yml") - # system "cp config/database.yml.sample config/database.yml" - # end - - puts "\n== Preparing database ==" - system "bin/rake db:setup" - - puts "\n== Removing old logs and tempfiles ==" - system "rm -f log/*" - system "rm -rf tmp/cache" - - puts "\n== Restarting application server ==" - system "touch tmp/restart.txt" -end diff --git a/spec/dummy/config.ru b/spec/dummy/config.ru deleted file mode 100644 index afd13e2..0000000 --- a/spec/dummy/config.ru +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -# This file is used by Rack-based servers to start the application. - -require File.expand_path('config/environment', __dir__) -run Rails.application diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index a9becd1..b1290cb 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -1,26 +1,16 @@ # frozen_string_literal: true -require File.expand_path('boot', __dir__) +require 'bundler/setup' +require 'active_record/railtie' -# Pick the frameworks you want: -require "active_record/railtie" -# require "rails/test_unit/railtie" - -Bundler.require(*Rails.groups) -require "with_transactional_lock" +Bundler.require(:default, Rails.env) +require 'with_transactional_lock' module Dummy class Application < Rails::Application - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. - # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' - - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - # config.i18n.default_locale = :de + config.root = File.expand_path('..', __dir__) + config.load_defaults Rails::VERSION::STRING.to_f + config.eager_load = Rails.env.test? + config.cache_classes = Rails.env.test? end end diff --git a/spec/dummy/config/boot.rb b/spec/dummy/config/boot.rb deleted file mode 100644 index 6d2cba0..0000000 --- a/spec/dummy/config/boot.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__) - -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) -$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__) diff --git a/spec/dummy/config/environment.rb b/spec/dummy/config/environment.rb index 32d57aa..5cacbed 100644 --- a/spec/dummy/config/environment.rb +++ b/spec/dummy/config/environment.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -# Load the Rails application. -require File.expand_path('application', __dir__) +require_relative 'application' -# Initialize the Rails application. Rails.application.initialize! diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb deleted file mode 100644 index 4fbd064..0000000 --- a/spec/dummy/config/environments/development.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Don't care if the mailer can't send. - # config.action_mailer.raise_delivery_errors = false - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # 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 - - # 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 - - # 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 - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true -end diff --git a/spec/dummy/config/environments/production.rb b/spec/dummy/config/environments/production.rb deleted file mode 100644 index f91115a..0000000 --- a/spec/dummy/config/environments/production.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Enable Rack::Cache to put a simple HTTP cache in front of your application - # Add `rack-cache` to your Gemfile before enabling this. - # For large-scale production use, consider using a caching reverse proxy like - # NGINX, varnish or squid. - # config.action_dispatch.rack_cache = true - - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? - - # Compress JavaScripts and CSS. - # 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 - - # 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.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # Use the lowest log level to ensure availability of diagnostic information - # when problems arise. - config.log_level = :debug - - # Prepend all log lines with the following tags. - # config.log_tags = [ :subdomain, :uuid ] - - # Use a different logger for distributed setups. - # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = Logger::Formatter.new - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false -end diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb deleted file mode 100644 index 8ea5737..0000000 --- a/spec/dummy/config/environments/test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - # config.action_mailer.delivery_method = :test - - # Randomize the order test cases are executed. - config.active_support.test_order = :random - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true -end diff --git a/spec/dummy/config/initializers/backtrace_silencers.rb b/spec/dummy/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 4b63f28..0000000 --- a/spec/dummy/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,9 +0,0 @@ -# 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. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/dummy/config/initializers/cookies_serializer.rb b/spec/dummy/config/initializers/cookies_serializer.rb deleted file mode 100644 index 0a23b25..0000000 --- a/spec/dummy/config/initializers/cookies_serializer.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/spec/dummy/config/initializers/filter_parameter_logging.rb b/spec/dummy/config/initializers/filter_parameter_logging.rb deleted file mode 100644 index 7a4f47b..0000000 --- a/spec/dummy/config/initializers/filter_parameter_logging.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] diff --git a/spec/dummy/config/initializers/inflections.rb b/spec/dummy/config/initializers/inflections.rb deleted file mode 100644 index dc84742..0000000 --- a/spec/dummy/config/initializers/inflections.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end diff --git a/spec/dummy/config/initializers/mime_types.rb b/spec/dummy/config/initializers/mime_types.rb deleted file mode 100644 index be6fedc..0000000 --- a/spec/dummy/config/initializers/mime_types.rb +++ /dev/null @@ -1,6 +0,0 @@ -# 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: -# Mime::Type.register "text/richtext", :rtf diff --git a/spec/dummy/config/initializers/session_store.rb b/spec/dummy/config/initializers/session_store.rb deleted file mode 100644 index 969d977..0000000 --- a/spec/dummy/config/initializers/session_store.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -Rails.application.config.session_store :cookie_store, key: '_dummy_session' diff --git a/spec/dummy/config/initializers/wrap_parameters.rb b/spec/dummy/config/initializers/wrap_parameters.rb deleted file mode 100644 index 246168a..0000000 --- a/spec/dummy/config/initializers/wrap_parameters.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] if respond_to?(:wrap_parameters) -end - -# To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end diff --git a/spec/dummy/config/locales/en.yml b/spec/dummy/config/locales/en.yml deleted file mode 100644 index 0653957..0000000 --- a/spec/dummy/config/locales/en.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb deleted file mode 100644 index 189947f..0000000 --- a/spec/dummy/config/routes.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -Rails.application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end -end diff --git a/spec/dummy/config/secrets.yml b/spec/dummy/config/secrets.yml deleted file mode 100644 index fbbad2c..0000000 --- a/spec/dummy/config/secrets.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -development: - secret_key_base: c00c0963d17e3a8739e04576d69a1437274f0e023dcb84fb4122b63c3232ef22d6c0db83be94df24f86bf10de043d2fb2cc103d2bad0908621eb637f63d39171 - -test: - secret_key_base: 21e08ccda8bb794e1d454fb61879035532c4381aa20663d8406c7ceb849c77c451571596d1540411363f4ba7bbdefe77780f5280bd9885224e5ca3cf60a3ed77 - -# Do not keep production secrets in the repository, -# instead read values from the environment. -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/spec/dummy/lib/assets/.keep b/spec/dummy/lib/assets/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/log/.keep b/spec/dummy/log/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/dummy/public/404.html b/spec/dummy/public/404.html deleted file mode 100644 index b612547..0000000 --- a/spec/dummy/public/404.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/spec/dummy/public/422.html b/spec/dummy/public/422.html deleted file mode 100644 index a21f82b..0000000 --- a/spec/dummy/public/422.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The change you wanted was rejected (422) - - - - - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/spec/dummy/public/500.html b/spec/dummy/public/500.html deleted file mode 100644 index 061abc5..0000000 --- a/spec/dummy/public/500.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/spec/dummy/public/favicon.ico b/spec/dummy/public/favicon.ico deleted file mode 100644 index e69de29..0000000 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0f8bb87..8373b9c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,7 +2,7 @@ rails_env = ENV['RAILS_ENV'] ||= 'test' db_adapter = ENV['DB_ADAPTER'] ||= 'postgresql' -require File.expand_path("dummy/config/environment.rb", __dir__) +require_relative 'dummy/config/environment' Rails.configuration.database_configuration[db_adapter][rails_env].tap do |c| ActiveRecord::Base.establish_connection(c) From 173892a8d26c3fc98b3c44df3b473ffc09225d99 Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:30:53 -0500 Subject: [PATCH 04/15] Fix bin/rails --- bin/rails | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/rails b/bin/rails index c6245e0..e341b60 100755 --- a/bin/rails +++ b/bin/rails @@ -1,12 +1,10 @@ #!/usr/bin/env ruby # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. -ENGINE_ROOT = File.expand_path('../..', __FILE__) -ENGINE_PATH = File.expand_path('../../lib/with_transactional_lock/engine', __FILE__) - -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +ENGINE_ROOT = File.expand_path('..', __dir__) +ENGINE_PATH = File.expand_path('../lib/with_transactional_lock/engine', __dir__) +APP_PATH = File.expand_path('../spec/dummy/config/application', __dir__) +require 'bundler/setup' require 'rails/all' require 'rails/engine/commands' From fdd5022da4ddda957b964b2f2af6e66c8c41658d Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:31:07 -0500 Subject: [PATCH 05/15] Remove unused rake tasks --- lib/tasks/with_transactional_lock_tasks.rake | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 lib/tasks/with_transactional_lock_tasks.rake diff --git a/lib/tasks/with_transactional_lock_tasks.rake b/lib/tasks/with_transactional_lock_tasks.rake deleted file mode 100644 index f3ee757..0000000 --- a/lib/tasks/with_transactional_lock_tasks.rake +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -# desc "Explaining what the task does" -# task :with_transactional_lock do -# # Task goes here -# end From 71bfe5b63b4cb98ac3f6aab8df049c35aeb98fab Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:36:20 -0500 Subject: [PATCH 06/15] Update appraisals --- .rubocop.yml | 2 + Appraisals | 6 ++- gemfiles/rails_7_0.gemfile | 5 +- gemfiles/rails_7_0.gemfile.lock | 86 ++------------------------------- gemfiles/rails_7_1.gemfile | 5 +- gemfiles/rails_7_1.gemfile.lock | 85 ++------------------------------ 6 files changed, 18 insertions(+), 171 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f19222c..09c3d54 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,6 +4,8 @@ inherit_gem: AllCops: TargetRubyVersion: 3.2 + Exclude: + - gemfiles/*.gemfile Gemspec/DevelopmentDependencies: Enabled: true diff --git a/Appraisals b/Appraisals index 2e65081..87d08ef 100644 --- a/Appraisals +++ b/Appraisals @@ -1,9 +1,11 @@ # frozen_string_literal: true appraise 'rails-7-0' do - gem 'rails', '~> 7.0.0' + gem 'activerecord', '~> 7.0.0' + gem 'railties', '~> 7.0.0' end appraise 'rails-7-1' do - gem 'rails', '~> 7.1.0' + gem 'activerecord', '~> 7.1.0' + gem 'railties', '~> 7.1.0' end diff --git a/gemfiles/rails_7_0.gemfile b/gemfiles/rails_7_0.gemfile index 6a2daed..02e0766 100644 --- a/gemfiles/rails_7_0.gemfile +++ b/gemfiles/rails_7_0.gemfile @@ -1,9 +1,8 @@ -# frozen_string_literal: true - # This file was generated by Appraisal source "https://rubygems.org" -gem "rails", "~> 7.0.0" +gem "activerecord", "~> 7.0.0" +gem "railties", "~> 7.0.0" gemspec path: "../" diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index bee46ce..6242ca8 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -2,36 +2,12 @@ PATH remote: .. specs: with_transactional_lock (2.2.0) - rails (>= 7.0, < 7.2) + activerecord (>= 7.0, < 7.2) + railties (>= 7.0, < 7.2) GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.8) - actionpack (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activesupport (= 7.0.8) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) actionpack (7.0.8) actionview (= 7.0.8) activesupport (= 7.0.8) @@ -39,34 +15,17 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8) - actionpack (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) - globalid (>= 0.6.0) - nokogiri (>= 1.8.5) actionview (7.0.8) activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8) - activesupport (= 7.0.8) - globalid (>= 0.3.6) activemodel (7.0.8) activesupport (= 7.0.8) activerecord (7.0.8) activemodel (= 7.0.8) activesupport (= 7.0.8) - activestorage (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activesupport (= 7.0.8) - marcel (~> 1.0) - mini_mime (>= 1.1.0) activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) @@ -92,11 +51,8 @@ GEM activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - date (3.3.4) diff-lcs (1.5.0) erubi (1.12.0) - globalid (1.2.1) - activesupport (>= 6.1) i18n (1.14.1) concurrent-ruby (~> 1.0) json (2.7.1) @@ -104,29 +60,12 @@ GEM 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.2) method_source (1.0.0) mime-types (3.5.1) mime-types-data (~> 3.2015) mime-types-data (3.2023.1205) - mini_mime (1.1.5) minitest (5.20.0) mysql2 (0.5.5) - net-imap (0.4.9) - date - net-protocol - net-pop (0.1.2) - net-protocol - net-protocol (0.2.2) - timeout - 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) @@ -142,20 +81,6 @@ GEM rack (2.2.8) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8) - actioncable (= 7.0.8) - actionmailbox (= 7.0.8) - actionmailer (= 7.0.8) - actionpack (= 7.0.8) - actiontext (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activemodel (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) - bundler (>= 1.15.0) - railties (= 7.0.8) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -229,13 +154,9 @@ GEM concurrent-ruby (~> 1.0) rack (> 1, < 3) thor (1.3.0) - timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - websocket-driver (0.7.6) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) zeitwerk (2.6.12) PLATFORMS @@ -244,13 +165,14 @@ PLATFORMS x86_64-linux DEPENDENCIES + activerecord (~> 7.0.0) appraisal (~> 2.2.0) betterlint database_cleaner mime-types mysql2 pg - rails (~> 7.0.0) + railties (~> 7.0.0) rspec-rails (~> 3.1) rspec-retry sprockets (~> 3.0) diff --git a/gemfiles/rails_7_1.gemfile b/gemfiles/rails_7_1.gemfile index 2470682..ef6a100 100644 --- a/gemfiles/rails_7_1.gemfile +++ b/gemfiles/rails_7_1.gemfile @@ -1,9 +1,8 @@ -# frozen_string_literal: true - # This file was generated by Appraisal source "https://rubygems.org" -gem "rails", "~> 7.1.0" +gem "activerecord", "~> 7.1.0" +gem "railties", "~> 7.1.0" gemspec path: "../" diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 5a8cdab..1649055 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -2,37 +2,12 @@ PATH remote: .. specs: with_transactional_lock (2.2.0) - rails (>= 7.0, < 7.2) + activerecord (>= 7.0, < 7.2) + railties (>= 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) @@ -43,34 +18,18 @@ GEM 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 @@ -104,12 +63,9 @@ GEM 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) @@ -121,29 +77,12 @@ GEM 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) @@ -164,20 +103,6 @@ GEM 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 @@ -262,9 +187,6 @@ GEM 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 @@ -272,13 +194,14 @@ PLATFORMS x86_64-linux DEPENDENCIES + activerecord (~> 7.1.0) appraisal (~> 2.2.0) betterlint database_cleaner mime-types mysql2 pg - rails (~> 7.1.0) + railties (~> 7.1.0) rspec-rails (~> 3.1) rspec-retry sprockets (~> 3.0) From d14cf9c90e9f2096de3b9e4903714b075eb488cf Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:39:53 -0500 Subject: [PATCH 07/15] Remove sprockets dependency --- Gemfile.lock | 4 ---- gemfiles/rails_7_0.gemfile.lock | 4 ---- gemfiles/rails_7_1.gemfile.lock | 4 ---- with_transactional_lock.gemspec | 1 - 4 files changed, 13 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3e402bb..994d6c0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -151,9 +151,6 @@ GEM 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) strscan (3.1.0) thor (1.3.0) tzinfo (2.0.6) @@ -175,7 +172,6 @@ DEPENDENCIES pg rspec-rails (~> 3.1) rspec-retry - sprockets (~> 3.0) with_transactional_lock! BUNDLED WITH diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index 6242ca8..964718e 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -150,9 +150,6 @@ GEM 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) thor (1.3.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -175,7 +172,6 @@ DEPENDENCIES railties (~> 7.0.0) rspec-rails (~> 3.1) rspec-retry - sprockets (~> 3.0) with_transactional_lock! BUNDLED WITH diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 1649055..4dea7da 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -177,9 +177,6 @@ GEM 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) @@ -204,7 +201,6 @@ DEPENDENCIES railties (~> 7.1.0) rspec-rails (~> 3.1) rspec-retry - sprockets (~> 3.0) with_transactional_lock! BUNDLED WITH diff --git a/with_transactional_lock.gemspec b/with_transactional_lock.gemspec index 4dc3754..7fab8cd 100644 --- a/with_transactional_lock.gemspec +++ b/with_transactional_lock.gemspec @@ -31,7 +31,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'pg' s.add_development_dependency 'rspec-rails', '~> 3.1' s.add_development_dependency 'rspec-retry' - s.add_development_dependency 'sprockets', '~> 3.0' s.required_ruby_version = '>= 3.2' end From 0f712cff74752a985290cf43cc0908ec7f233ced Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:41:41 -0500 Subject: [PATCH 08/15] Fix deprecations by upgrading rspec-rails --- Gemfile.lock | 44 ++++++++--------- gemfiles/rails_7_0.gemfile.lock | 64 ++++++++++++------------- gemfiles/rails_7_1.gemfile.lock | 84 ++++++++++++++++----------------- with_transactional_lock.gemspec | 2 +- 4 files changed, 96 insertions(+), 98 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 994d6c0..8e1ba16 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,16 +51,16 @@ GEM activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - diff-lcs (1.5.0) + diff-lcs (1.5.1) erubi (1.13.0) i18n (1.14.6) concurrent-ruby (~> 1.0) json (2.7.1) language_server-protocol (3.17.0.3) - loofah (2.22.0) + loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) - method_source (1.0.0) + method_source (1.1.0) mime-types (3.5.1) mime-types-data (~> 3.2015) mime-types-data (3.2023.1205) @@ -96,29 +96,29 @@ GEM thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.1) regexp_parser (2.8.3) rexml (3.3.6) strscan - rspec-core (3.9.3) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.4) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) 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-support (~> 3.13.0) + rspec-rails (7.1.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.9.4) + rspec-support (3.13.1) rubocop (1.59.0) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -152,11 +152,11 @@ GEM rubocop-factory_bot (~> 2.22) ruby-progressbar (1.13.0) strscan (3.1.0) - thor (1.3.0) + thor (1.3.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - zeitwerk (2.6.12) + zeitwerk (2.7.1) PLATFORMS arm64-darwin-22 @@ -170,7 +170,7 @@ DEPENDENCIES mime-types mysql2 pg - rspec-rails (~> 3.1) + rspec-rails rspec-retry with_transactional_lock! diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index 964718e..5340f2a 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -42,8 +42,8 @@ GEM rubocop-rails rubocop-rake rubocop-rspec (>= 2.24) - builder (3.2.4) - concurrent-ruby (1.2.2) + builder (3.3.0) + concurrent-ruby (1.3.4) crass (1.0.6) database_cleaner (2.0.2) database_cleaner-active_record (>= 2, < 3) @@ -51,34 +51,34 @@ GEM activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - diff-lcs (1.5.0) - erubi (1.12.0) - i18n (1.14.1) + diff-lcs (1.5.1) + erubi (1.13.0) + i18n (1.14.6) concurrent-ruby (~> 1.0) json (2.7.1) language_server-protocol (3.17.0.3) - loofah (2.22.0) + loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) - method_source (1.0.0) + method_source (1.1.0) mime-types (3.5.1) mime-types-data (~> 3.2015) mime-types-data (3.2023.1205) - minitest (5.20.0) + minitest (5.25.1) mysql2 (0.5.5) - nokogiri (1.16.0-arm64-darwin) + nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.0-x86_64-darwin) + nokogiri (1.16.7-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.0-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) parallel (1.24.0) parser (3.2.2.4) ast (~> 2.4.1) racc pg (1.5.4) - racc (1.7.3) - rack (2.2.8) + racc (1.8.1) + rack (2.2.10) rack-test (2.1.0) rack (>= 1.3) rails-dom-testing (2.2.0) @@ -96,28 +96,28 @@ GEM thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.1) regexp_parser (2.8.3) rexml (3.2.6) - rspec-core (3.9.3) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.4) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) 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-support (~> 3.13.0) + rspec-rails (7.1.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.9.4) + rspec-support (3.13.1) rubocop (1.59.0) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -150,11 +150,11 @@ GEM rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) ruby-progressbar (1.13.0) - thor (1.3.0) + thor (1.3.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - zeitwerk (2.6.12) + zeitwerk (2.7.1) PLATFORMS arm64-darwin-22 @@ -170,7 +170,7 @@ DEPENDENCIES mysql2 pg railties (~> 7.0.0) - rspec-rails (~> 3.1) + rspec-rails rspec-retry with_transactional_lock! diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 4dea7da..49d1b49 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -52,9 +52,9 @@ GEM rubocop-rails rubocop-rake rubocop-rspec (>= 2.24) - bigdecimal (3.1.7) - builder (3.2.4) - concurrent-ruby (1.2.3) + bigdecimal (3.1.8) + builder (3.3.0) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) database_cleaner (2.0.2) @@ -65,44 +65,43 @@ GEM database_cleaner-core (2.0.1) diff-lcs (1.5.1) drb (2.2.1) - erubi (1.12.0) - i18n (1.14.4) + erubi (1.13.0) + i18n (1.14.6) concurrent-ruby (~> 1.0) io-console (0.7.2) - irb (1.12.0) - rdoc + irb (1.14.1) + rdoc (>= 4.0.0) reline (>= 0.4.2) json (2.7.1) language_server-protocol (3.17.0.3) - loofah (2.22.0) + loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) mime-types (3.5.2) mime-types-data (~> 3.2015) mime-types-data (3.2024.0305) - minitest (5.22.3) - mutex_m (0.2.0) + minitest (5.25.1) + mutex_m (0.3.0) mysql2 (0.5.6) - nokogiri (1.16.3-arm64-darwin) + nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.3-x86_64-linux) + nokogiri (1.16.7-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) + psych (5.2.0) stringio - racc (1.7.3) - rack (2.2.8.1) - rack-session (1.0.2) - rack (< 3) + racc (1.8.1) + rack (3.1.8) + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (1.0.0) - rack (< 3) - webrick + rackup (2.2.1) + rack (>= 3) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -119,32 +118,32 @@ GEM thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.1.0) - rdoc (6.6.2) + rake (13.2.1) + rdoc (6.8.1) psych (>= 4.0.0) regexp_parser (2.9.0) - reline (0.4.3) + reline (0.5.11) io-console (~> 0.5) rexml (3.2.6) - rspec-core (3.9.3) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.4) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) 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-support (~> 3.13.0) + rspec-rails (7.1.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.9.4) + rspec-support (3.13.1) rubocop (1.62.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -177,14 +176,13 @@ GEM rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) ruby-progressbar (1.13.0) - stringio (3.1.0) - thor (1.3.1) + stringio (3.1.2) + thor (1.3.2) timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - webrick (1.8.1) - zeitwerk (2.6.13) + zeitwerk (2.7.1) PLATFORMS arm64-darwin-22 @@ -199,7 +197,7 @@ DEPENDENCIES mysql2 pg railties (~> 7.1.0) - rspec-rails (~> 3.1) + rspec-rails rspec-retry with_transactional_lock! diff --git a/with_transactional_lock.gemspec b/with_transactional_lock.gemspec index 7fab8cd..ce51ec7 100644 --- a/with_transactional_lock.gemspec +++ b/with_transactional_lock.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'mime-types' s.add_development_dependency 'mysql2' s.add_development_dependency 'pg' - s.add_development_dependency 'rspec-rails', '~> 3.1' + s.add_development_dependency 'rspec-rails' s.add_development_dependency 'rspec-retry' s.required_ruby_version = '>= 3.2' From a57e128958e69675648317caa5b38021f4e11d8b Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:42:42 -0500 Subject: [PATCH 09/15] Upgrade betterlint --- Gemfile | 2 + Gemfile.lock | 58 +++++++++++++++------------- bin/rails | 2 + gemfiles/rails_7_0.gemfile.lock | 56 +++++++++++++++------------ gemfiles/rails_7_1.gemfile.lock | 48 +++++++++++++---------- lib/with_transactional_lock/mixin.rb | 12 +++--- 6 files changed, 99 insertions(+), 79 deletions(-) diff --git a/Gemfile b/Gemfile index fa75df1..7f4f5e9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://rubygems.org' gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 8e1ba16..a082333 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,12 +36,13 @@ GEM rake thor (>= 0.14.0) ast (2.4.2) - betterlint (1.7.0) - rubocop (> 1.0) - rubocop-performance - rubocop-rails - rubocop-rake - rubocop-rspec (>= 2.24) + betterlint (1.16.0) + rubocop (~> 1.62.0) + rubocop-graphql (~> 1.5.0) + rubocop-performance (~> 1.21.0) + rubocop-rails (~> 2.24.0) + rubocop-rake (~> 0.6.0) + rubocop-rspec (~> 2.28.0) builder (3.3.0) concurrent-ruby (1.3.4) crass (1.0.6) @@ -55,7 +56,7 @@ GEM erubi (1.13.0) i18n (1.14.6) concurrent-ruby (~> 1.0) - json (2.7.1) + json (2.8.2) language_server-protocol (3.17.0.3) loofah (2.23.1) crass (~> 1.0.2) @@ -72,8 +73,8 @@ GEM racc (~> 1.4) nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) - parallel (1.24.0) - parser (3.2.2.4) + parallel (1.26.3) + parser (3.3.6.0) ast (~> 2.4.1) racc pg (1.5.4) @@ -97,9 +98,8 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.8.3) - rexml (3.3.6) - strscan + regexp_parser (2.9.2) + rexml (3.3.9) rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) @@ -119,43 +119,47 @@ GEM rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.13.1) - rubocop (1.59.0) + rubocop (1.62.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + 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.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.19.0) + rubocop-ast (1.36.1) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-factory_bot (2.24.0) - rubocop (~> 1.33) - rubocop-performance (1.20.1) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-graphql (1.5.4) + rubocop (>= 1.50, < 2) + rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rails (2.23.1) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.24.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.25.0) + rubocop-rspec (2.28.0) rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) ruby-progressbar (1.13.0) - strscan (3.1.0) thor (1.3.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) zeitwerk (2.7.1) PLATFORMS diff --git a/bin/rails b/bin/rails index e341b60..e25a140 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. ENGINE_ROOT = File.expand_path('..', __dir__) diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index 5340f2a..397183c 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -36,12 +36,13 @@ GEM rake thor (>= 0.14.0) ast (2.4.2) - betterlint (1.7.0) - rubocop (> 1.0) - rubocop-performance - rubocop-rails - rubocop-rake - rubocop-rspec (>= 2.24) + betterlint (1.16.0) + rubocop (~> 1.62.0) + rubocop-graphql (~> 1.5.0) + rubocop-performance (~> 1.21.0) + rubocop-rails (~> 2.24.0) + rubocop-rake (~> 0.6.0) + rubocop-rspec (~> 2.28.0) builder (3.3.0) concurrent-ruby (1.3.4) crass (1.0.6) @@ -55,7 +56,7 @@ GEM erubi (1.13.0) i18n (1.14.6) concurrent-ruby (~> 1.0) - json (2.7.1) + json (2.8.2) language_server-protocol (3.17.0.3) loofah (2.23.1) crass (~> 1.0.2) @@ -72,8 +73,8 @@ GEM racc (~> 1.4) nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) - parallel (1.24.0) - parser (3.2.2.4) + parallel (1.26.3) + parser (3.3.6.0) ast (~> 2.4.1) racc pg (1.5.4) @@ -97,8 +98,8 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.8.3) - rexml (3.2.6) + regexp_parser (2.9.2) + rexml (3.3.9) rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) @@ -118,42 +119,47 @@ GEM rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.13.1) - rubocop (1.59.0) + rubocop (1.62.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + 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.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.19.0) + rubocop-ast (1.36.1) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-factory_bot (2.24.0) - rubocop (~> 1.33) - rubocop-performance (1.20.1) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-graphql (1.5.4) + rubocop (>= 1.50, < 2) + rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rails (2.23.1) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.24.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.25.0) + rubocop-rspec (2.28.0) rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) ruby-progressbar (1.13.0) thor (1.3.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) zeitwerk (2.7.1) PLATFORMS diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 49d1b49..3b781e9 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -46,12 +46,13 @@ GEM 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) + betterlint (1.16.0) + rubocop (~> 1.62.0) + rubocop-graphql (~> 1.5.0) + rubocop-performance (~> 1.21.0) + rubocop-rails (~> 2.24.0) + rubocop-rake (~> 0.6.0) + rubocop-rspec (~> 2.28.0) bigdecimal (3.1.8) builder (3.3.0) concurrent-ruby (1.3.4) @@ -72,7 +73,7 @@ GEM irb (1.14.1) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.7.1) + json (2.8.2) language_server-protocol (3.17.0.3) loofah (2.23.1) crass (~> 1.0.2) @@ -87,8 +88,8 @@ GEM racc (~> 1.4) nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) - parallel (1.24.0) - parser (3.3.0.5) + parallel (1.26.3) + parser (3.3.6.0) ast (~> 2.4.1) racc pg (1.5.6) @@ -121,10 +122,10 @@ GEM rake (13.2.1) rdoc (6.8.1) psych (>= 4.0.0) - regexp_parser (2.9.0) + regexp_parser (2.9.2) reline (0.5.11) io-console (~> 0.5) - rexml (3.2.6) + rexml (3.3.9) rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) @@ -155,33 +156,38 @@ GEM 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-ast (1.36.1) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-factory_bot (2.25.1) - rubocop (~> 1.41) - rubocop-performance (1.20.2) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-graphql (1.5.4) + rubocop (>= 1.50, < 2) + rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rails (2.24.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.24.1) 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-rspec (2.28.0) rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) ruby-progressbar (1.13.0) stringio (3.1.2) thor (1.3.2) timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) zeitwerk (2.7.1) PLATFORMS diff --git a/lib/with_transactional_lock/mixin.rb b/lib/with_transactional_lock/mixin.rb index 849cfd1..c611eb3 100644 --- a/lib/with_transactional_lock/mixin.rb +++ b/lib/with_transactional_lock/mixin.rb @@ -23,12 +23,12 @@ module AdvisoryLockClassLocator def self.locate(connection) adapter = connection.adapter_name.downcase.to_sym case adapter - when :mysql, :mysql2 - MySqlAdvisoryLock - when :postgresql - PostgresAdvisoryLock - else - raise "adapter not supported: #{adapter}" + when :mysql, :mysql2 + MySqlAdvisoryLock + when :postgresql + PostgresAdvisoryLock + else + raise "adapter not supported: #{adapter}" end end end From 55d8ad71f2914f45caecfe4f504567388d2897d9 Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:43:24 -0500 Subject: [PATCH 10/15] Upgrade pg --- Gemfile.lock | 2 +- gemfiles/rails_7_0.gemfile.lock | 2 +- gemfiles/rails_7_1.gemfile.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a082333..b40924f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -77,7 +77,7 @@ GEM parser (3.3.6.0) ast (~> 2.4.1) racc - pg (1.5.4) + pg (1.5.9) racc (1.8.1) rack (2.2.10) rack-test (2.1.0) diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index 397183c..e871151 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -77,7 +77,7 @@ GEM parser (3.3.6.0) ast (~> 2.4.1) racc - pg (1.5.4) + pg (1.5.9) racc (1.8.1) rack (2.2.10) rack-test (2.1.0) diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 3b781e9..ec5e1f6 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -92,7 +92,7 @@ GEM parser (3.3.6.0) ast (~> 2.4.1) racc - pg (1.5.6) + pg (1.5.9) psych (5.2.0) stringio racc (1.8.1) From 2f7ee47ec5c50ca7e19d727dfdad4943b74269e4 Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:43:47 -0500 Subject: [PATCH 11/15] Upgrade mysql2 --- Gemfile.lock | 2 +- gemfiles/rails_7_0.gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b40924f..3cd9053 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,7 +66,7 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2023.1205) minitest (5.25.1) - mysql2 (0.5.5) + mysql2 (0.5.6) nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) nokogiri (1.16.7-x86_64-darwin) diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index e871151..4586d98 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -66,7 +66,7 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2023.1205) minitest (5.25.1) - mysql2 (0.5.5) + mysql2 (0.5.6) nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) nokogiri (1.16.7-x86_64-darwin) From cb64d7093e4f1649fd5088d366c57dd4de30bea8 Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:44:26 -0500 Subject: [PATCH 12/15] Remove mime-types dependency --- Gemfile.lock | 4 ---- gemfiles/rails_7_0.gemfile.lock | 4 ---- gemfiles/rails_7_1.gemfile.lock | 4 ---- spec/spec_helper.rb | 1 - with_transactional_lock.gemspec | 1 - 5 files changed, 14 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3cd9053..a1dd27a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,9 +62,6 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.12.0) method_source (1.1.0) - mime-types (3.5.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2023.1205) minitest (5.25.1) mysql2 (0.5.6) nokogiri (1.16.7-arm64-darwin) @@ -171,7 +168,6 @@ DEPENDENCIES appraisal (~> 2.2.0) betterlint database_cleaner - mime-types mysql2 pg rspec-rails diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index 4586d98..eb3ca2b 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -62,9 +62,6 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.12.0) method_source (1.1.0) - mime-types (3.5.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2023.1205) minitest (5.25.1) mysql2 (0.5.6) nokogiri (1.16.7-arm64-darwin) @@ -172,7 +169,6 @@ DEPENDENCIES appraisal (~> 2.2.0) betterlint database_cleaner - mime-types mysql2 pg railties (~> 7.0.0) diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index ec5e1f6..929196f 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -78,9 +78,6 @@ GEM loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mime-types (3.5.2) - mime-types-data (~> 3.2015) - mime-types-data (3.2024.0305) minitest (5.25.1) mutex_m (0.3.0) mysql2 (0.5.6) @@ -199,7 +196,6 @@ DEPENDENCIES appraisal (~> 2.2.0) betterlint database_cleaner - mime-types mysql2 pg railties (~> 7.1.0) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8373b9c..8ec4518 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,7 +13,6 @@ require 'rspec/rails' require 'rspec/retry' -require 'mime-types' require 'database_cleaner' class Widget < ActiveRecord::Base diff --git a/with_transactional_lock.gemspec b/with_transactional_lock.gemspec index ce51ec7..b49b8cb 100644 --- a/with_transactional_lock.gemspec +++ b/with_transactional_lock.gemspec @@ -26,7 +26,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'appraisal', '~> 2.2.0' s.add_development_dependency 'betterlint' s.add_development_dependency 'database_cleaner' - s.add_development_dependency 'mime-types' s.add_development_dependency 'mysql2' s.add_development_dependency 'pg' s.add_development_dependency 'rspec-rails' From 31beeea38eba79975216db093db941697cf50cb7 Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:46:05 -0500 Subject: [PATCH 13/15] Upgrade database_cleaner --- Gemfile.lock | 2 +- gemfiles/rails_7_0.gemfile.lock | 4 ++-- gemfiles/rails_7_1.gemfile.lock | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a1dd27a..8ea2b8f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,7 +46,7 @@ GEM builder (3.3.0) concurrent-ruby (1.3.4) crass (1.0.6) - database_cleaner (2.0.2) + database_cleaner (2.1.0) database_cleaner-active_record (>= 2, < 3) database_cleaner-active_record (2.2.0) activerecord (>= 5.a) diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index eb3ca2b..8afe77d 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -46,9 +46,9 @@ GEM builder (3.3.0) concurrent-ruby (1.3.4) crass (1.0.6) - database_cleaner (2.0.2) + database_cleaner (2.1.0) database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.1.0) + database_cleaner-active_record (2.2.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index 929196f..ca2f3f9 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -58,9 +58,9 @@ GEM concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) - database_cleaner (2.0.2) + database_cleaner (2.1.0) database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.1.0) + database_cleaner-active_record (2.2.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) @@ -181,7 +181,7 @@ GEM ruby-progressbar (1.13.0) stringio (3.1.2) thor (1.3.2) - timeout (0.4.1) + timeout (0.4.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.6.0) From 8d5405a8622ba4468a486b73e2d3900c660e59be Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 10:54:21 -0500 Subject: [PATCH 14/15] Bump version --- Gemfile.lock | 2 +- gemfiles/rails_7_0.gemfile.lock | 2 +- gemfiles/rails_7_1.gemfile.lock | 2 +- lib/with_transactional_lock/version.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8ea2b8f..e464f8f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - with_transactional_lock (2.2.0) + with_transactional_lock (2.3.0) activerecord (>= 7.0, < 7.2) railties (>= 7.0, < 7.2) diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index 8afe77d..1e4d3cc 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - with_transactional_lock (2.2.0) + with_transactional_lock (2.3.0) activerecord (>= 7.0, < 7.2) railties (>= 7.0, < 7.2) diff --git a/gemfiles/rails_7_1.gemfile.lock b/gemfiles/rails_7_1.gemfile.lock index ca2f3f9..70c954f 100644 --- a/gemfiles/rails_7_1.gemfile.lock +++ b/gemfiles/rails_7_1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - with_transactional_lock (2.2.0) + with_transactional_lock (2.3.0) activerecord (>= 7.0, < 7.2) railties (>= 7.0, < 7.2) diff --git a/lib/with_transactional_lock/version.rb b/lib/with_transactional_lock/version.rb index a9b7a6b..a311af0 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.2.0" + VERSION = "2.3.0" end From bb64bf2c8a32ffdd0769745a4ad0649ccb41b5fd Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Wed, 20 Nov 2024 11:09:26 -0500 Subject: [PATCH 15/15] Extend excludes --- .rubocop.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 09c3d54..a781ced 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,10 @@ inherit_gem: betterlint: - config/default.yml +inherit_mode: + merge: + - Exclude + AllCops: TargetRubyVersion: 3.2 Exclude: