|
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') |
7 | | -solidus_git, solidus_frontend_git = if (branch == 'master') || (branch >= 'v3.2') |
8 | | - %w[solidusio/solidus solidusio/solidus_frontend] |
9 | | - else |
10 | | - %w[solidusio/solidus] * 2 |
11 | | - end |
12 | | -gem 'solidus', github: solidus_git, branch: branch |
13 | | -gem 'solidus_frontend', github: solidus_frontend_git, branch: branch |
| 6 | +branch = ENV.fetch("SOLIDUS_BRANCH", "main") |
| 7 | +gem "solidus", github: "solidusio/solidus", branch: branch |
| 8 | + |
| 9 | +# The solidus_frontend gem has been pulled out since v3.2 |
| 10 | +if branch >= "v3.2" |
| 11 | + gem "solidus_frontend" |
| 12 | +elsif branch == "main" |
| 13 | + gem "solidus_frontend", github: "solidusio/solidus_frontend", branch: branch |
| 14 | +else |
| 15 | + gem "solidus_frontend", github: "solidusio/solidus", branch: branch |
| 16 | +end |
14 | 17 |
|
15 | 18 | # Needed to help Bundler figure out how to resolve dependencies, |
16 | 19 | # otherwise it takes forever to resolve them. |
17 | 20 | # See https://github.com/bundler/bundler/issues/6677 |
18 | | -gem 'rails', '>0.a' |
| 21 | +gem "rails", ">0.a" |
19 | 22 |
|
20 | 23 | # Provides basic authentication functionality for testing parts of your engine |
21 | | -gem 'solidus_auth_devise' |
22 | | -gem 'solidus_dev_support' |
23 | | - |
24 | | -case ENV['DB'] |
25 | | -when 'mysql' |
26 | | - gem 'mysql2' |
27 | | -when 'postgresql' |
28 | | - gem 'pg' |
| 24 | +gem "solidus_auth_devise" |
| 25 | + |
| 26 | +case ENV.fetch("DB", nil) |
| 27 | +when "mysql" |
| 28 | + gem "mysql2" |
| 29 | +when "postgresql" |
| 30 | + gem "pg" |
29 | 31 | else |
30 | | - gem 'sqlite3' |
| 32 | + gem "sqlite3" |
| 33 | +end |
| 34 | + |
| 35 | +group :development, :test do |
| 36 | + gem "factory_bot", "> 4.10.0" |
| 37 | + gem "pry-rails" |
31 | 38 | end |
32 | 39 |
|
33 | 40 | group :test do |
34 | | - gem 'rails-controller-testing' |
35 | | - gem 'rspec-activemodel-mocks' |
| 41 | + gem "rails-controller-testing" |
| 42 | + gem "rspec-activemodel-mocks" |
36 | 43 | end |
37 | 44 |
|
| 45 | +# While we still support Ruby < 3 we need to workaround a limitation in |
| 46 | +# the "async" gem that relies on the latest ruby, since RubyGems doesn"t |
| 47 | +# resolve gems based on the required ruby version. |
| 48 | +gem "async", "< 3" if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3") |
| 49 | + |
38 | 50 | gemspec |
| 51 | + |
| 52 | +# Use a local Gemfile to include development dependencies that might not be |
| 53 | +# relevant for the project or for other contributors, e.g. pry-byebug. |
| 54 | +# |
| 55 | +# We use `send` instead of calling `eval_gemfile` to work around an issue with |
| 56 | +# how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658. |
| 57 | +send(:eval_gemfile, "Gemfile-local") if File.exist? "Gemfile-local" |
0 commit comments