Move development dependencies to Gemfile

This is more flexible anyways (you can point to git gems, for example),
but in this case it fixes an issue, because conditional dependencis in
the gemspec don't really work that way:

* On one hand, if I point to ransack through using `:path` or `:git`, I
would need to have the ENV["RAILS"] variable defined so that I can
bundle my application.

* If I point to a released gem, development_dependencies are ignored
anyways, but the specific value of the requirement would be set
unconditionally according to the `ENV["RAILS"]` value at release time,
definitely not what's expected
This commit is contained in:
David Rodríguez 2019-08-18 20:43:16 +02:00
parent d3dbed56b9
commit 8c92a3b1f6
No known key found for this signature in database
GPG Key ID: 1008A258BB37309C
2 changed files with 8 additions and 9 deletions

View File

@ -5,7 +5,12 @@ gem 'rake'
rails = ENV['RAILS'] || '6-0-stable'
gem 'pry'
gem 'faker', '~> 0.9.5'
gem 'sqlite3', ::Gem::Version.new(ENV['RAILS']&.gsub(/^v/, '')) >= ::Gem::Version.new('6-0-stable') ? '~> 1.4.1' : '~> 1.3.3'
gem 'pg', '~> 0.21'
gem 'mysql2', '0.3.20'
gem 'pry', '0.10'
gem 'byebug'
# Provide timezone information on Windows
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
@ -33,6 +38,8 @@ end
gem 'mysql2', '~> 0.5.2'
group :test do
gem 'machinist', '~> 1.0.6'
gem 'rspec', '~> 3'
# TestUnit was removed from Ruby 2.2 but still needed for testing Rails 3.x.
gem 'test-unit', '~> 3.0' if RUBY_VERSION >= '2.2'
gem 'simplecov', :require => false

View File

@ -19,14 +19,6 @@ Gem::Specification.new do |s|
s.add_dependency 'activesupport', '>= 5.0'
s.add_dependency 'i18n'
s.add_dependency 'polyamorous', Ransack::VERSION.to_s
s.add_development_dependency 'rspec', '~> 3'
s.add_development_dependency 'machinist', '~> 1.0.6'
s.add_development_dependency 'faker', '~> 0.9.5'
s.add_development_dependency 'sqlite3', ::Gem::Version.new(ENV['RAILS']&.gsub(/^v/, '')) >= ::Gem::Version.new('6-0-stable') ? '~> 1.4.1' : '~> 1.3.3'
s.add_development_dependency 'pg', '~> 0.21'
s.add_development_dependency 'mysql2', '0.3.20'
s.add_development_dependency 'pry', '0.10'
s.add_development_dependency 'byebug'
s.files = `git ls-files`.split("\n")