From b3e962fedf52ab265c95f65918d58e9f84b55e81 Mon Sep 17 00:00:00 2001 From: Pascal Zumkehr Date: Wed, 8 Jun 2022 09:26:26 +0200 Subject: [PATCH] Depend only on activerecord and railties instead of all rails --- Gemfile | 3 +- Gemfile.lock | 102 ++---------------- gemfiles/Gemfile-5-0 | 3 +- gemfiles/Gemfile-5-2 | 3 +- gemfiles/Gemfile-6-0 | 3 +- gemfiles/Gemfile-6-1 | 3 +- gemfiles/Gemfile-7-0 | 3 +- rails-settings-cached.gemspec | 4 +- test/dummy/config/application.rb | 4 +- test/dummy/config/environments/development.rb | 6 +- test/dummy/config/environments/production.rb | 2 +- test/dummy/config/environments/test.rb | 4 +- 12 files changed, 35 insertions(+), 105 deletions(-) diff --git a/Gemfile b/Gemfile index 49a47ce..a979ee0 100644 --- a/Gemfile +++ b/Gemfile @@ -3,4 +3,5 @@ source "https://rubygems.org" gemspec -gem "rails", "~> 7.0.0" +gem "railties", "~> 7.0.0" +gem "activerecord", "~> 7.0.0" diff --git a/Gemfile.lock b/Gemfile.lock index 34c68a8..0f37fa7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,36 +2,12 @@ PATH remote: . specs: rails-settings-cached (2.8.2) - rails (>= 5.0.0) + activerecord (>= 5.0.0) + railties (>= 5.0.0) GEM remote: https://rubygems.org/ specs: - actioncable (7.0.2.2) - actionpack (= 7.0.2.2) - activesupport (= 7.0.2.2) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (7.0.2.2) - actionpack (= 7.0.2.2) - activejob (= 7.0.2.2) - activerecord (= 7.0.2.2) - activestorage (= 7.0.2.2) - activesupport (= 7.0.2.2) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.2.2) - actionpack (= 7.0.2.2) - actionview (= 7.0.2.2) - activejob (= 7.0.2.2) - activesupport (= 7.0.2.2) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) actionpack (7.0.2.2) actionview (= 7.0.2.2) activesupport (= 7.0.2.2) @@ -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.2.2) - actionpack (= 7.0.2.2) - activerecord (= 7.0.2.2) - activestorage (= 7.0.2.2) - activesupport (= 7.0.2.2) - globalid (>= 0.6.0) - nokogiri (>= 1.8.5) actionview (7.0.2.2) activesupport (= 7.0.2.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.2.2) - activesupport (= 7.0.2.2) - globalid (>= 0.3.6) activemodel (7.0.2.2) activesupport (= 7.0.2.2) activerecord (7.0.2.2) activemodel (= 7.0.2.2) activesupport (= 7.0.2.2) - activestorage (7.0.2.2) - actionpack (= 7.0.2.2) - activejob (= 7.0.2.2) - activerecord (= 7.0.2.2) - activesupport (= 7.0.2.2) - marcel (~> 1.0) - mini_mime (>= 1.1.0) activesupport (7.0.2.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) @@ -76,66 +35,28 @@ GEM builder (3.2.4) concurrent-ruby (1.1.9) crass (1.0.6) - digest (3.1.0) erubi (1.10.0) - globalid (1.0.0) - activesupport (>= 5.0) i18n (1.10.0) concurrent-ruby (~> 1.0) - io-wait (0.2.1) - loofah (2.14.0) + loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - marcel (1.0.2) method_source (1.0.0) - mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - net-imap (0.2.3) - digest - net-protocol - strscan - net-pop (0.1.1) - digest - net-protocol - timeout - net-protocol (0.1.2) - io-wait - timeout - net-smtp (0.3.1) - digest - net-protocol - timeout - nio4r (2.5.8) - nokogiri (1.13.3) + nokogiri (1.13.6) mini_portile2 (~> 2.8.0) racc (~> 1.4) - nokogiri (1.13.3-x86_64-darwin) + nokogiri (1.13.6-x86_64-darwin) racc (~> 1.4) parallel (1.21.0) parser (3.1.0.0) ast (~> 2.4.1) pg (1.2.3) racc (1.6.0) - rack (2.2.3) + rack (2.2.3.1) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (7.0.2.2) - actioncable (= 7.0.2.2) - actionmailbox (= 7.0.2.2) - actionmailer (= 7.0.2.2) - actionpack (= 7.0.2.2) - actiontext (= 7.0.2.2) - actionview (= 7.0.2.2) - activejob (= 7.0.2.2) - activemodel (= 7.0.2.2) - activerecord (= 7.0.2.2) - activestorage (= 7.0.2.2) - activesupport (= 7.0.2.2) - bundler (>= 1.15.0) - railties (= 7.0.2.2) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) @@ -165,15 +86,10 @@ GEM parser (>= 3.0.1.1) ruby-progressbar (1.11.0) sqlite3 (1.4.2) - strscan (3.0.1) thor (1.2.1) - timeout (0.2.0) tzinfo (2.0.4) concurrent-ruby (~> 1.0) unicode-display_width (2.1.0) - websocket-driver (0.7.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) zeitwerk (2.5.4) PLATFORMS @@ -181,12 +97,14 @@ PLATFORMS x86_64-darwin-20 DEPENDENCIES + activerecord (~> 7.0.0) minitest pg - rails (~> 7.0.0) rails-settings-cached! + railties (~> 7.0.0) + rake rubocop sqlite3 BUNDLED WITH - 2.2.23 + 2.2.31 diff --git a/gemfiles/Gemfile-5-0 b/gemfiles/Gemfile-5-0 index b7afc1f..90d232e 100644 --- a/gemfiles/Gemfile-5-0 +++ b/gemfiles/Gemfile-5-0 @@ -1,6 +1,7 @@ source 'https://rubygems.org' -gem 'rails', "~> 5.0.0" +gem 'railties', "~> 5.0.0" +gem 'activerecord', "~> 5.0.0" gem 'sqlite3', "~> 1.3.13" gem 'request_store' diff --git a/gemfiles/Gemfile-5-2 b/gemfiles/Gemfile-5-2 index 2189335..17a755f 100644 --- a/gemfiles/Gemfile-5-2 +++ b/gemfiles/Gemfile-5-2 @@ -1,6 +1,7 @@ source 'https://rubygems.org' -gem 'rails', "~> 5.2.0" +gem 'railties', "~> 5.2.0" +gem 'activerecord', "~> 5.2.0" gem 'sqlite3', "~> 1.3.13" gemspec :path => '..' diff --git a/gemfiles/Gemfile-6-0 b/gemfiles/Gemfile-6-0 index ca6a0d0..9f55ae4 100644 --- a/gemfiles/Gemfile-6-0 +++ b/gemfiles/Gemfile-6-0 @@ -1,6 +1,7 @@ source "https://rubygems.org" -gem "rails", "~> 6.0.4" +gem "railties", "~> 6.0.4" +gem "activerecord", "~> 6.0.4" gem "sqlite3", "~> 1.4.2" gemspec path: ".." diff --git a/gemfiles/Gemfile-6-1 b/gemfiles/Gemfile-6-1 index 0f20098..404b3f9 100644 --- a/gemfiles/Gemfile-6-1 +++ b/gemfiles/Gemfile-6-1 @@ -1,6 +1,7 @@ source "https://rubygems.org" -gem "rails", "~> 6.1.4" +gem "railties", "~> 6.1.4" +gem "activerecord", "~> 6.1.4" gem "sqlite3", "~> 1.4.2" gemspec path: ".." diff --git a/gemfiles/Gemfile-7-0 b/gemfiles/Gemfile-7-0 index 9454fc5..2deef7f 100644 --- a/gemfiles/Gemfile-7-0 +++ b/gemfiles/Gemfile-7-0 @@ -1,6 +1,7 @@ source "https://rubygems.org" -gem "rails", "~> 7.0.0" +gem "railties", "~> 7.0.0" +gem "activerecord", "~> 7.0.0" gem "sqlite3", "~> 1.4.2" gemspec path: ".." diff --git a/rails-settings-cached.gemspec b/rails-settings-cached.gemspec index ea0e8df..9342d21 100644 --- a/rails-settings-cached.gemspec +++ b/rails-settings-cached.gemspec @@ -25,9 +25,11 @@ Gem::Specification.new do |s| You can store any kind of object. Strings, numbers, arrays, or any object. " - s.add_dependency "rails", ">= 5.0.0" + s.add_dependency "railties", ">= 5.0.0" + s.add_dependency "activerecord", ">= 5.0.0" s.add_development_dependency "pg" + s.add_development_dependency "rake" s.add_development_dependency "minitest" s.add_development_dependency "rubocop" s.add_development_dependency "sqlite3" diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index 5909071..fbaaad5 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -1,6 +1,8 @@ require_relative "boot" -require "rails/all" +require "rails" +require "active_record/railtie" +require "action_controller/railtie" Bundler.require(*Rails.groups) require "rails-settings-cached" diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb index 50fbc67..0336515 100644 --- a/test/dummy/config/environments/development.rb +++ b/test/dummy/config/environments/development.rb @@ -12,6 +12,8 @@ # Show full error reports. config.consider_all_requests_local = true + config.hosts << "www.example.com" + # Enable/disable caching. By default caching is disabled. config.action_controller.perform_caching = true @@ -20,9 +22,9 @@ } # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false + # config.action_mailer.raise_delivery_errors = false - config.action_mailer.perform_caching = false + # config.action_mailer.perform_caching = false # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb index 31105f3..1b27fa8 100644 --- a/test/dummy/config/environments/production.rb +++ b/test/dummy/config/environments/production.rb @@ -46,7 +46,7 @@ # Use a real queuing backend for Active Job (and separate queues per environment) # config.active_job.queue_adapter = :resque # config.active_job.queue_name_prefix = "dummy_#{Rails.env}" - config.action_mailer.perform_caching = false + # config.action_mailer.perform_caching = false # 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. diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index 5ada7c6..2dceb3f 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -27,12 +27,12 @@ # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false - config.action_mailer.perform_caching = false + # config.action_mailer.perform_caching = 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 + # config.action_mailer.delivery_method = :test # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr