Skip to content

Commit

Permalink
Update Chosen gem for rails 7.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lfarrell committed Jan 29, 2024
1 parent dcae96c commit aeb2d53
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 1 deletion.
78 changes: 78 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
source 'https://rubygems.org'

# See https://github.com/rubygems/rubygems/issues/2731 for why we can't declare this the gemspec file
gem 'trln-chosen-rails', git: 'https://github.com/trln/chosen-rails', branch: 'rails-7'

# Declare your gem's dependencies in trln_argon.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
Expand All @@ -20,6 +23,7 @@ gemspec
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
if File.exist?(file)
begin
gem 'trln-chosen-rails', git: 'https://github.com/trln/chosen-rails', branch: 'rails-7'
eval_gemfile file
rescue Bundler::GemfileError => e
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
Expand Down Expand Up @@ -54,6 +58,7 @@ end
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
if File.exist?(file)
begin
gem 'trln-chosen-rails', git: 'https://github.com/trln/chosen-rails', branch: 'rails-7'
eval_gemfile file
rescue Bundler::GemfileError => e
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
Expand Down Expand Up @@ -88,6 +93,7 @@ end
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
if File.exist?(file)
begin
gem 'trln-chosen-rails', git: 'https://github.com/trln/chosen-rails', branch: 'rails-7'
eval_gemfile file
rescue Bundler::GemfileError => e
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
Expand Down Expand Up @@ -121,6 +127,78 @@ end
# engine_cart stanza: 2.5.0
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
if File.exist?(file)
begin
gem 'trln-chosen-rails', git: 'https://github.com/trln/chosen-rails', branch: 'rails-7'
eval_gemfile file
rescue Bundler::GemfileError => e
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
Bundler.ui.warn e.message
end
else
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"

if ENV['RAILS_VERSION']
if ENV['RAILS_VERSION'] == 'edge'
gem 'rails', github: 'rails/rails'
ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
else
gem 'rails', ENV['RAILS_VERSION']
end

case ENV['RAILS_VERSION']
when /^6.0/
gem 'sass-rails', '>= 6'
gem 'webpacker', '~> 4.0'
when /^5.[12]/
gem 'sass-rails', '~> 5.0'
gem 'sprockets', '~> 3.7'
gem 'thor', '~> 0.20'
end
end
end
# END ENGINE_CART BLOCK
# BEGIN ENGINE_CART BLOCK
# engine_cart: 2.6.0
# engine_cart stanza: 2.5.0
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
if File.exist?(file)
begin
gem 'trln-chosen-rails', git: 'https://github.com/trln/chosen-rails', branch: 'rails-7'
eval_gemfile file
rescue Bundler::GemfileError => e
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
Bundler.ui.warn e.message
end
else
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"

if ENV['RAILS_VERSION']
if ENV['RAILS_VERSION'] == 'edge'
gem 'rails', github: 'rails/rails'
ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
else
gem 'rails', ENV['RAILS_VERSION']
end

case ENV['RAILS_VERSION']
when /^6.0/
gem 'sass-rails', '>= 6'
gem 'webpacker', '~> 4.0'
when /^5.[12]/
gem 'sass-rails', '~> 5.0'
gem 'sprockets', '~> 3.7'
gem 'thor', '~> 0.20'
end
end
end
# END ENGINE_CART BLOCK
# BEGIN ENGINE_CART BLOCK
# engine_cart: 2.6.0
# engine_cart stanza: 2.5.0
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
if File.exist?(file)
begin
eval_gemfile file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class TestAppGenerator < Rails::Generators::Base

def add_gems
gem 'blacklight', '~> 7.0'
gem 'trln-chosen-rails', git: 'https://github.com/trln/chosen-rails', branch: 'rails-7'
gsub_file 'Gemfile', /^gem ["']sqlite3["']$/, 'gem "sqlite3", "~> 1.4.2"'

Bundler.with_clean_env do
Expand Down
1 change: 0 additions & 1 deletion trln_argon.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Gem::Specification.new do |s|
s.add_dependency 'library_stdnums', '~> 1.6'
s.add_dependency 'openurl', '~>1.0'
s.add_dependency 'font-awesome-rails', '~> 4.7'
s.add_dependency 'chosen-rails', '~> 1.10'
s.add_dependency 'coffee-rails', '~> 4.2'
s.add_dependency 'rsolr', '>= 1.0', '< 3'
s.add_dependency 'addressable', '~> 2.5'
Expand Down

0 comments on commit aeb2d53

Please sign in to comment.