Skip to content

Commit

Permalink
Use Gem::Version for Ruby version comparisons in Gemfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyhs committed Jun 11, 2019
1 parent edbae5d commit ed7c3bb
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ source "https://rubygems.org"
ruby_version = Gem::Version.new(RUBY_VERSION)

group :test, optional: true do
gem 'rake', RUBY_VERSION <= '1.9.3' ? '~> 11.3.0' : '~> 12.3.0'
gem 'rspec'
gem 'rspec-mocks'
gem 'rdoc', '~> 5.1.0'
gem 'pry'
gem 'addressable', '~> 2.3.8'
gem 'delayed_job' if RUBY_VERSION >= '2.2.2'
gem 'i18n', RUBY_VERSION <= '2.3.0' ? '1.4.0': '>1.4.0' if RUBY_VERSION >= '2.2.2'
gem 'webmock', RUBY_VERSION <= '1.9.3' ? '2.3.2': '>2.3.2'
gem 'hashdiff', RUBY_VERSION <= '1.9.3' ? '0.3.8': '>0.3.8'
gem 'rake', ruby_version <= Gem::Version.new('1.9.3') ? '~> 11.3.0' : '~> 12.3.0'
gem 'rspec'
gem 'rspec-mocks'
gem 'rdoc', '~> 5.1.0'
gem 'pry'
gem 'addressable', '~> 2.3.8'
gem 'delayed_job' if ruby_version >= Gem::Version.new('2.2.2')
gem 'i18n', ruby_version <= Gem::Version.new('2.3.0') ? '1.4.0': '>1.4.0' if ruby_version >= Gem::Version.new('2.2.2')
gem 'webmock', ruby_version <= Gem::Version.new('1.9.3') ? '2.3.2': '>2.3.2'
gem 'hashdiff', ruby_version <= Gem::Version.new('1.9.3') ? '0.3.8': '>0.3.8'
end

group :coverage, optional: true do
Expand All @@ -26,6 +26,7 @@ end

group :sidekiq, optional: true do
gem 'sidekiq', '~> 5.0.4'
# redis 4.1.2 dropped support for Ruby 2.2
gem 'redis', ruby_version < Gem::Version.new('2.3.0') ? '4.1.1' : '>= 4.1.2'
end

Expand All @@ -34,7 +35,7 @@ group :doc, optional: true do
end

group :maze, optional: true do
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner' if RUBY_VERSION >= '2.0.0'
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner' if ruby_version >= Gem::Version.new('2.0.0')
end

gemspec

0 comments on commit ed7c3bb

Please sign in to comment.