From 1b715da86f3b5b99ff6674080b1cdc427e349c30 Mon Sep 17 00:00:00 2001 From: Thilo Utke Date: Thu, 27 Aug 2020 13:33:21 +0200 Subject: [PATCH 1/2] stop depending on all rails libs only railties, activerecord, activejob --- Gemfile.lock | 63 +------------------ gemfiles/rails_5.2.gemfile.lock | 4 +- gemfiles/rails_6.0.gemfile.lock | 4 +- good_job.gemspec | 4 +- spec/support/example_app_helper.rb | 2 +- spec/test_app/config/application.rb | 2 +- .../config/environments/development.rb | 10 +-- .../config/environments/production.rb | 6 +- spec/test_app/config/initializers/assets.rb | 2 +- 9 files changed, 23 insertions(+), 74 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ccd38557f..0c3072ef9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,31 +2,16 @@ PATH remote: . specs: good_job (1.2.2) + activejob (>= 5.1.0) + activerecord (>= 5.1.0) concurrent-ruby (>= 1.0.2) pg (>= 1.0.0) - rails (>= 5.1.0) + railties (>= 5.1.0) thor (>= 0.14.1) GEM remote: https://rubygems.org/ specs: - actioncable (6.0.3.2) - actionpack (= 6.0.3.2) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (6.0.3.2) - actionpack (= 6.0.3.2) - activejob (= 6.0.3.2) - activerecord (= 6.0.3.2) - activestorage (= 6.0.3.2) - activesupport (= 6.0.3.2) - mail (>= 2.7.1) - actionmailer (6.0.3.2) - actionpack (= 6.0.3.2) - actionview (= 6.0.3.2) - activejob (= 6.0.3.2) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) actionpack (6.0.3.2) actionview (= 6.0.3.2) activesupport (= 6.0.3.2) @@ -34,12 +19,6 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.3.2) - actionpack (= 6.0.3.2) - activerecord (= 6.0.3.2) - activestorage (= 6.0.3.2) - activesupport (= 6.0.3.2) - nokogiri (>= 1.8.5) actionview (6.0.3.2) activesupport (= 6.0.3.2) builder (~> 3.1) @@ -54,11 +33,6 @@ GEM activerecord (6.0.3.2) activemodel (= 6.0.3.2) activesupport (= 6.0.3.2) - activestorage (6.0.3.2) - actionpack (= 6.0.3.2) - activejob (= 6.0.3.2) - activerecord (= 6.0.3.2) - marcel (~> 0.3.1) activesupport (6.0.3.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) @@ -102,13 +76,7 @@ GEM loofah (2.6.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) method_source (1.0.0) - mimemagic (0.3.5) - mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.14.1) msgpack (1.3.3) @@ -136,21 +104,6 @@ GEM rack (2.2.3) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.3.2) - actioncable (= 6.0.3.2) - actionmailbox (= 6.0.3.2) - actionmailer (= 6.0.3.2) - actionpack (= 6.0.3.2) - actiontext (= 6.0.3.2) - actionview (= 6.0.3.2) - activejob (= 6.0.3.2) - activemodel (= 6.0.3.2) - activerecord (= 6.0.3.2) - activestorage (= 6.0.3.2) - activesupport (= 6.0.3.2) - bundler (>= 1.3.0) - railties (= 6.0.3.2) - sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) @@ -212,21 +165,11 @@ GEM addressable (>= 2.3.5) faraday (> 0.8, < 2.0) sigdump (0.2.4) - sprockets (4.0.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) thor (1.0.1) thread_safe (0.3.6) tzinfo (1.2.7) thread_safe (~> 0.1) unicode-display_width (1.7.0) - websocket-driver (0.7.3) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) yard (0.9.25) zeitwerk (2.3.1) diff --git a/gemfiles/rails_5.2.gemfile.lock b/gemfiles/rails_5.2.gemfile.lock index b16815c62..2460deb23 100644 --- a/gemfiles/rails_5.2.gemfile.lock +++ b/gemfiles/rails_5.2.gemfile.lock @@ -2,9 +2,11 @@ PATH remote: .. specs: good_job (1.2.2) + activejob (>= 5.1.0) + activerecord (>= 5.1.0) concurrent-ruby (>= 1.0.2) pg (>= 1.0.0) - rails (>= 5.1.0) + railties (>= 5.1.0) thor (>= 0.14.1) GEM diff --git a/gemfiles/rails_6.0.gemfile.lock b/gemfiles/rails_6.0.gemfile.lock index 066062b37..02198723f 100644 --- a/gemfiles/rails_6.0.gemfile.lock +++ b/gemfiles/rails_6.0.gemfile.lock @@ -2,9 +2,11 @@ PATH remote: .. specs: good_job (1.2.2) + activejob (>= 5.1.0) + activerecord (>= 5.1.0) concurrent-ruby (>= 1.0.2) pg (>= 1.0.0) - rails (>= 5.1.0) + railties (>= 5.1.0) thor (>= 0.14.1) GEM diff --git a/good_job.gemspec b/good_job.gemspec index 1d211c66f..ab539b10e 100644 --- a/good_job.gemspec +++ b/good_job.gemspec @@ -39,7 +39,9 @@ Gem::Specification.new do |spec| spec.add_dependency "concurrent-ruby", ">= 1.0.2" spec.add_dependency "pg", ">= 1.0.0" - spec.add_dependency "rails", ">= 5.1.0" + spec.add_dependency "railties", ">= 5.1.0" + spec.add_dependency "activerecord", ">= 5.1.0" + spec.add_dependency "activejob", ">= 5.1.0" spec.add_dependency "thor", ">= 0.14.1" spec.add_development_dependency "appraisal" diff --git a/spec/support/example_app_helper.rb b/spec/support/example_app_helper.rb index 6f5e2caa9..ecc8a18a8 100644 --- a/spec/support/example_app_helper.rb +++ b/spec/support/example_app_helper.rb @@ -5,7 +5,7 @@ def setup_example_app root_path = example_app_path.join('..') FileUtils.cd(root_path) do - `rails new #{app_name} -d postgresql --skip-action-mailer --skip-action-mailbox --skip-action-cable --skip-sprockets --skip-listen --skip-javascript --skip-turbolinks --skip-system-test --skip-test-unit --skip-bootsnap --skip-spring` + `rails new #{app_name} -d postgresql --no-assets --skip-action-text --skip-action-mailer --skip-action-mailbox --skip-action-cable --skip-sprockets --skip-listen --skip-javascript --skip-turbolinks --skip-system-test --skip-test-unit --skip-bootsnap --skip-spring --skip-active-storage` end File.open("#{example_app_path}/Gemfile", 'a') do |f| diff --git a/spec/test_app/config/application.rb b/spec/test_app/config/application.rb index 1142578ec..9c4c0ad66 100644 --- a/spec/test_app/config/application.rb +++ b/spec/test_app/config/application.rb @@ -16,7 +16,7 @@ class Application < Rails::Application # the framework and any gems in your application. # - config.middleware.insert_before Rack::Sendfile, ActionDispatch::DebugLocks + # config.middleware.insert_before Rack::Sendfile, ActionDispatch::DebugLocks config.log_level = :debug end end diff --git a/spec/test_app/config/environments/development.rb b/spec/test_app/config/environments/development.rb index 7e49c005b..a90e14493 100644 --- a/spec/test_app/config/environments/development.rb +++ b/spec/test_app/config/environments/development.rb @@ -29,12 +29,12 @@ end # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = :local + # config.active_storage.service = :local # 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 @@ -48,10 +48,10 @@ # Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. - config.assets.debug = true + # config.assets.debug = true # Suppress logger output for asset requests. - config.assets.quiet = true + # config.assets.quiet = true # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true diff --git a/spec/test_app/config/environments/production.rb b/spec/test_app/config/environments/production.rb index 94a8c2c02..564a6b140 100644 --- a/spec/test_app/config/environments/production.rb +++ b/spec/test_app/config/environments/production.rb @@ -26,7 +26,7 @@ # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false + # config.assets.compile = false # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' @@ -36,7 +36,7 @@ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = :local + # config.active_storage.service = :local # Mount Action Cable outside main process or domain. # config.action_cable.mount_path = nil @@ -60,7 +60,7 @@ # config.active_job.queue_adapter = :resque # config.active_job.queue_name_prefix = "test_app_production" - 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/spec/test_app/config/initializers/assets.rb b/spec/test_app/config/initializers/assets.rb index fe48fc34e..9c7a620b5 100644 --- a/spec/test_app/config/initializers/assets.rb +++ b/spec/test_app/config/initializers/assets.rb @@ -1,7 +1,7 @@ # Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = '1.0' +# Rails.application.config.assets.version = '1.0' # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path From b3c0352b24e7c76c985a4ed453a4b81b7c4c31e5 Mon Sep 17 00:00:00 2001 From: Thilo Utke Date: Thu, 27 Aug 2020 13:43:25 +0200 Subject: [PATCH 2/2] fixed dependency order --- good_job.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/good_job.gemspec b/good_job.gemspec index ab539b10e..a16980343 100644 --- a/good_job.gemspec +++ b/good_job.gemspec @@ -37,11 +37,11 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 2.4.0" + spec.add_dependency "activejob", ">= 5.1.0" + spec.add_dependency "activerecord", ">= 5.1.0" spec.add_dependency "concurrent-ruby", ">= 1.0.2" spec.add_dependency "pg", ">= 1.0.0" spec.add_dependency "railties", ">= 5.1.0" - spec.add_dependency "activerecord", ">= 5.1.0" - spec.add_dependency "activejob", ">= 5.1.0" spec.add_dependency "thor", ">= 0.14.1" spec.add_development_dependency "appraisal"