|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -source 'https://rubygems.org' |
| 3 | +source "https://rubygems.org" |
4 | 4 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } |
5 | 5 |
|
6 | | -branch = ENV.fetch('SOLIDUS_BRANCH', 'master') |
| 6 | +branch = ENV.fetch("SOLIDUS_BRANCH", "main") |
| 7 | +gem "solidus", github: "solidusio/solidus", branch: branch |
| 8 | +gem "solidus_backend", github: "solidusio/solidus", branch: branch |
7 | 9 |
|
8 | | -git "https://github.com/solidusio/solidus.git", branch: branch do |
9 | | - gem 'solidus_api' |
10 | | - gem 'solidus_backend' |
11 | | - gem 'solidus_core' |
12 | | - gem 'solidus_frontend' |
13 | | - gem 'solidus_sample' |
14 | | -end |
| 10 | +rails_requirement_string = ENV.fetch("RAILS_VERSION", "~> 7.0") |
| 11 | +gem "rails", rails_requirement_string |
15 | 12 |
|
16 | | -gem 'rails', ENV.fetch('RAILS_VERSION', nil) |
| 13 | +# The solidus_frontend gem has been pulled out since v3.2 |
| 14 | +if branch >= "v3.2" |
| 15 | + gem "solidus_frontend" |
| 16 | +elsif branch == "main" |
| 17 | + gem "solidus_frontend", github: "solidusio/solidus_frontend" |
| 18 | +else |
| 19 | + gem "solidus_frontend", github: "solidusio/solidus", branch: branch |
| 20 | +end |
17 | 21 |
|
18 | | -case ENV['DB'] |
19 | | -when 'mysql' |
20 | | - gem 'mysql2' |
21 | | -when 'postgresql' |
22 | | - gem 'pg' |
| 22 | +case ENV.fetch("DB", nil) |
| 23 | +when "mysql" |
| 24 | + gem "mysql2" |
| 25 | +when "postgresql" |
| 26 | + gem "pg" |
23 | 27 | else |
24 | | - gem 'sqlite3' |
| 28 | + rails_version = Gem::Requirement.new(rails_requirement_string).requirements[0][1] |
| 29 | + sqlite_version = (rails_version < Gem::Version.new(7.2)) ? "~> 1.4" : "~> 2.0" |
| 30 | + |
| 31 | + gem "sqlite3", sqlite_version |
| 32 | +end |
| 33 | + |
| 34 | +if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3") |
| 35 | + # While we still support Ruby < 3 we need to workaround a limitation in |
| 36 | + # the 'async' gem that relies on the latest ruby, since RubyGems doesn't |
| 37 | + # resolve gems based on the required ruby version. |
| 38 | + gem "async", "< 3", require: false |
25 | 39 | end |
26 | 40 |
|
27 | | -gem 'rails-controller-testing', group: :test |
| 41 | +# 'net/smtp' is required by 'mail', see: |
| 42 | +# - https://github.com/ruby/net-protocol/issues/10 |
| 43 | +# - https://stackoverflow.com/a/72474475 |
| 44 | +gem "net-smtp", require: false |
28 | 45 |
|
29 | 46 | gemspec |
30 | 47 |
|
31 | 48 | # Use a local Gemfile to include development dependencies that might not be |
32 | | -# relevant for the project or for other contributors, e.g.: `gem 'pry-debug'`. |
33 | | -eval_gemfile 'Gemfile-local' if File.exist? 'Gemfile-local' |
| 49 | +# relevant for the project or for other contributors, e.g. pry-byebug. |
| 50 | +# |
| 51 | +# We use `send` instead of calling `eval_gemfile` to work around an issue with |
| 52 | +# how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658. |
| 53 | +send(:eval_gemfile, "Gemfile-local") if File.exist? "Gemfile-local" |
| 54 | + |
| 55 | +# Pin state_machines |
| 56 | +gem "state_machines", "= 0.6.0" |
0 commit comments