Skip to content

Commit

Permalink
Revise sqlite3 version hack for engine_cart in test_app_generator.rb …
Browse files Browse the repository at this point in the history
…so test suite succeeds in Ruby 2.7.

- See cbeer/engine_cart@9607722
- Documented in cbeer/engine_cart#125
  • Loading branch information
seanaery committed Feb 20, 2024
1 parent 5c95a65 commit 271dbbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion spec/test_app_templates/lib/generators/test_app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ class TestAppGenerator < Rails::Generators::Base

def add_gems
gem 'blacklight', '~> 7.0'
gsub_file 'Gemfile', /^gem ["']sqlite3["']$/, 'gem "sqlite3", "~> 1.4.2"'

if RUBY_VERSION < '3.0'
# Hack for https://github.com/cbeer/engine_cart/issues/125
gsub_file 'Gemfile', /^gem ["']sqlite3["']$/, 'gem "sqlite3", "< 1.7"'
end

Bundler.with_clean_env do
run 'bundle install'
Expand Down
4 changes: 1 addition & 3 deletions trln_argon.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ Gem::Specification.new do |s|
s.add_dependency 'sprockets', '~> 4.0'
s.add_dependency 'trln-chosen-rails', '~> 1.20'

# no version specified for sqlite3 because engine_cart 2.2
# will otherwise use an incompatible version when generating
# the internal rails app (rails 5.2.3 required for sqlite3 1.4.0)
s.add_development_dependency 'sqlite3'
s.add_development_dependency 'rspec-rails', '~> 5'
s.add_development_dependency 'capybara', '~> 3.29'
s.add_development_dependency 'pry', '~> 0.14'
Expand Down

0 comments on commit 271dbbb

Please sign in to comment.