Skip to content

Commit

Permalink
Don't warn or use Gemfile.extra when not using engine_cart (#4962)
Browse files Browse the repository at this point in the history
* Don't warn or use Gemfile.extra when not using engine_cart

* Appease rubocop

* Appease rubocop
  • Loading branch information
cjcolvar authored May 20, 2021
1 parent 7102303 commit 46630bd
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,18 @@ test_app_path = ENV['RAILS_ROOT'] ||
ENV.fetch('ENGINE_CART_DESTINATION', File.expand_path('.internal_test_app', File.dirname(__FILE__)))
test_app_gemfile = File.expand_path('Gemfile', test_app_path)

# rubocop:disable Bundler/DuplicatedGem
if File.exist?(test_app_gemfile)
begin
eval_gemfile test_app_gemfile
rescue Bundler::GemfileError => e
Bundler.ui.warn '[Hyrax] Skipping Rails application dependencies:'
Bundler.ui.warn e.message
end
else
Bundler.ui.warn "[Hyrax] Unable to find test application dependencies in #{test_app_gemfile}, using placeholder dependencies"

# rubocop:disable Bundler/DuplicatedGem
if ENV['RAILS_VERSION']
if ENV['RAILS_VERSION'] == 'edge'
gem 'rails', github: 'rails/rails', source: 'https://rubygems.org'
ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
else
gem 'rails', ENV['RAILS_VERSION'], source: 'https://rubygems.org'
end
end
# rubocop:enable Bundler/DuplicatedGem

eval_gemfile File.expand_path('spec/test_app_templates/Gemfile.extra', File.dirname(__FILE__))
elsif ENV['RAILS_VERSION'] == 'edge'
gem 'rails', github: 'rails/rails', source: 'https://rubygems.org'
ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
elsif ENV['RAILS_VERSION']
gem 'rails', ENV['RAILS_VERSION'], source: 'https://rubygems.org'
end
# rubocop:enable Bundler/DuplicatedGem

0 comments on commit 46630bd

Please sign in to comment.