Skip to content

Commit

Permalink
Remove rails dependency, slim down the dummy app, and upgrade depen…
Browse files Browse the repository at this point in the history
…dencies (#21)

This gem currently depends on `rails`, which means it depends on gems
like `actiontext`, `activestorage`, `actioncable`. That's a mistake.
This gem only depends on Active Record and Railties (for generators).

I also:
* Upgrade all dependencies
* Removed unnecessary stuff from `spec/dummy`
* Fixed `bin/rails`
* Removed `sprockets` dev dependency
* Removed `mime-types` dev dependency
  • Loading branch information
rzane authored Nov 20, 2024
1 parent 2aa5aac commit 90148ac
Show file tree
Hide file tree
Showing 53 changed files with 251 additions and 1,187 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ inherit_gem:
betterlint:
- config/default.yml

inherit_mode:
merge:
- Exclude

AllCops:
TargetRubyVersion: 3.2
Exclude:
- gemfiles/*.gemfile

Gemspec/DevelopmentDependencies:
Enabled: true
Expand Down
6 changes: 4 additions & 2 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gemspec
201 changes: 59 additions & 142 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,72 +1,31 @@
PATH
remote: .
specs:
with_transactional_lock (2.2.0)
rails (>= 7.0, < 7.2)
with_transactional_lock (2.3.0)
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)
rack (~> 2.0, >= 2.2.4)
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)
Expand All @@ -77,85 +36,49 @@ 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)
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)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.4)
diff-lcs (1.5.0)
diff-lcs (1.5.1)
erubi (1.13.0)
globalid (1.2.1)
activesupport (>= 6.1)
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.22.0)
loofah (2.23.1)
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)
method_source (1.1.0)
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)
mysql2 (0.5.6)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
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)
pg (1.5.9)
racc (1.8.1)
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
Expand All @@ -171,74 +94,70 @@ GEM
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.1.0)
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)
rake (13.2.1)
regexp_parser (2.9.2)
rexml (3.3.9)
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)
rubocop (1.59.0)
rspec-support (3.13.1)
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)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
strscan (3.1.0)
thor (1.3.0)
timeout (0.4.1)
thor (1.3.2)
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)
unicode-display_width (2.6.0)
zeitwerk (2.7.1)

PLATFORMS
arm64-darwin-22
Expand All @@ -249,12 +168,10 @@ DEPENDENCIES
appraisal (~> 2.2.0)
betterlint
database_cleaner
mime-types
mysql2
pg
rspec-rails (~> 3.1)
rspec-rails
rspec-retry
sprockets (~> 3.0)
with_transactional_lock!

BUNDLED WITH
Expand Down
12 changes: 6 additions & 6 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/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.
# frozen_string_literal: true

ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/with_transactional_lock/engine', __FILE__)
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.

# 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'
5 changes: 2 additions & 3 deletions gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
@@ -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: "../"
Loading

0 comments on commit 90148ac

Please sign in to comment.