|
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', 'main') |
7 | | -gem 'solidus', github: 'solidusio/solidus', branch: branch |
| 6 | +branch = ENV.fetch("SOLIDUS_BRANCH", "main") |
| 7 | +gem "solidus", github: "solidusio/solidus", branch: branch |
8 | 8 |
|
9 | 9 | # The solidus_frontend gem has been pulled out since v3.2 |
10 | | -gem 'solidus_frontend' |
| 10 | +if branch >= "v3.2" |
| 11 | + gem "solidus_frontend" |
| 12 | +elsif branch == "main" |
| 13 | + gem "solidus_frontend", github: "solidusio/solidus_frontend" |
| 14 | +else |
| 15 | + gem "solidus_frontend", github: "solidusio/solidus", branch: branch |
| 16 | +end |
11 | 17 |
|
12 | | -rails_version = ENV.fetch('RAILS_VERSION', '7.2') |
13 | | -gem 'rails', "~> #{rails_version}" |
| 18 | +if branch <= "v4.5" || branch == "main" |
| 19 | + gem "state_machines", "<= 0.6" |
| 20 | +end |
14 | 21 |
|
15 | | -case ENV['DB'] |
16 | | -when 'mysql' |
17 | | - gem 'mysql2' |
18 | | -when 'postgresql' |
19 | | - gem 'pg' |
| 22 | +rails_version = ENV.fetch("RAILS_VERSION", "7.0") |
| 23 | +gem "rails", "~> #{rails_version}" |
| 24 | + |
| 25 | +case ENV.fetch("DB", nil) |
| 26 | +when "mysql" |
| 27 | + gem "mysql2" |
| 28 | +when "postgresql" |
| 29 | + gem "pg" |
20 | 30 | else |
21 | | - if rails_version <= "7.2" |
22 | | - gem 'sqlite3', "~> 1.7" |
23 | | - else |
24 | | - gem 'sqlite3', "~> 2.0" |
25 | | - end |
| 31 | + gem "sqlite3", (rails_version < "7.2") ? "~> 1.4" : "~> 2.0" |
26 | 32 | end |
27 | 33 |
|
| 34 | +if rails_version == "7.0" |
| 35 | + gem "concurrent-ruby", "< 1.3.5" |
| 36 | +end |
| 37 | + |
| 38 | +if RUBY_VERSION >= "3.4" |
| 39 | + # Solidus Promotions uses CSV but does not have it as dependency yet. |
| 40 | + gem "csv" |
| 41 | +end |
| 42 | + |
| 43 | +# While we still support Ruby < 3 we need to workaround a limitation in |
| 44 | +# the 'async' gem that relies on the latest ruby, since RubyGems doesn't |
| 45 | +# resolve gems based on the required ruby version. |
| 46 | +gem "async", "< 3" if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3") |
| 47 | + |
28 | 48 | gemspec |
29 | 49 |
|
30 | 50 | # Use a local Gemfile to include development dependencies that might not be |
31 | 51 | # relevant for the project or for other contributors, e.g. pry-byebug. |
32 | 52 | # |
33 | 53 | # We use `send` instead of calling `eval_gemfile` to work around an issue with |
34 | 54 | # how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658. |
35 | | -send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local' |
| 55 | +send(:eval_gemfile, "Gemfile-local") if File.exist? "Gemfile-local" |
0 commit comments