diff --git a/Gemfile b/Gemfile index f44d9d1e..135db956 100644 --- a/Gemfile +++ b/Gemfile @@ -7,21 +7,10 @@ branch = ENV.fetch('SOLIDUS_BRANCH', 'main') gem 'solidus', github: 'solidusio/solidus', branch: branch # The solidus_frontend gem has been pulled out since v3.2 -if branch >= 'v3.2' - gem 'solidus_frontend' -elsif branch == 'main' - gem 'solidus_frontend', github: 'solidusio/solidus_frontend', branch: branch -else - gem 'solidus_frontend', github: 'solidusio/solidus', branch: branch -end - -# Needed for Rails 7.0 -gem 'concurrent-ruby', '< 1.3.5' +gem 'solidus_frontend' -# Needed to help Bundler figure out how to resolve dependencies, -# otherwise it takes forever to resolve them. -# See https://github.com/bundler/bundler/issues/6677 -gem 'rails', '>0.a' +rails_requirement_string = ENV.fetch('RAILS_VERSION', '~> 7.0') +gem 'rails', rails_requirement_string case ENV.fetch('DB', nil) when 'mysql' @@ -29,13 +18,11 @@ when 'mysql' when 'postgresql' gem 'pg' else - gem 'sqlite3', '~> 1.4' -end + rails_version = Gem::Requirement.new(rails_requirement_string).requirements[0][1] + sqlite_version = rails_version < Gem::Version.new(7.2) ? "~> 1.4" : "~> 2.0" -# While we still support Ruby < 3 we need to workaround a limitation in -# the 'async' gem that relies on the latest ruby, since RubyGems doesn't -# resolve gems based on the required ruby version. -gem 'async', '< 3' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3') + gem 'sqlite3', sqlite_version +end gemspec