Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Remove Ruby version constraint workarounds #2773

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 11 additions & 35 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ branch = File.read(File.expand_path("../maintenance-branch", __FILE__)).chomp
end
end

if RUBY_VERSION < '1.9.3'
gem 'rake', '< 11.0.0' # rake 11 requires Ruby 1.9.3 or later
elsif RUBY_VERSION < '2.0.0'
gem 'rake', '< 12.0.0' # rake 12 requires Ruby 2.0.0 or later
else
gem 'rake', '> 12.3.2'
end
gem 'rake'

if ENV['DIFF_LCS_VERSION']
gem 'diff-lcs', ENV['DIFF_LCS_VERSION']
Expand All @@ -34,33 +28,13 @@ group :documentation do
gem 'github-markup', :platform => :mri
end

if RUBY_VERSION < '2.0.0' || RUBY_ENGINE == 'java'
gem 'json', '< 2.0.0'
else
gem 'json', '> 2.3.0'
end

if RUBY_VERSION < '2.2.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
gem 'ffi', '< 1.10'
elsif RUBY_VERSION < '2.0'
gem 'ffi', '< 1.9.19' # ffi dropped Ruby 1.8 support in 1.9.19
else
gem 'ffi', '~> 1.11.0'
end

if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
gem "childprocess", "< 1.0.0"
end

platforms :jruby do
if RUBY_VERSION < '1.9.0'
# Pin jruby-openssl on older J Ruby
gem "jruby-openssl", "< 0.10.0"
# Pin child-process on older J Ruby
gem "childprocess", "< 1.0.0"
else
gem "jruby-openssl"
end
# Pin child-process on older JRuby
gem "childprocess", "< 1.0.0" if RUBY_VERSION < '1.9.0'
end

gem 'simplecov', '~> 0.8'
Expand All @@ -70,14 +44,16 @@ if RUBY_VERSION >= '2.4' && RUBY_ENGINE == 'ruby'
gem "rubocop", "~> 0.52.1"
end

gem 'test-unit', '~> 3.0' if RUBY_VERSION.to_f >= 2.2
# Contracts gem denies that it uses Ruby 2.0 syntax
gem 'contracts', '< 0.16' if RUBY_VERSION < '1.9.0'

# Version 5.12 of minitest requires Ruby 2.4
if RUBY_VERSION < '2.4.0'
gem 'minitest', '< 5.12.0'
end
# json 2.2.0 denies that it needs Ruby 2.0
gem 'json', '< 2.0.0' if RUBY_VERSION < '2.0.0' || RUBY_ENGINE == 'java'

# Test::Unit was removed from stdlib in Ruby 2.2
gem 'test-unit', '~> 3.0' if RUBY_VERSION.to_f >= 2.2

gem 'contracts', '< 0.16' if RUBY_VERSION < '1.9.0'
# Minitest version 5.12.0 relies on Ruby 2.4, but denies it
gem 'minitest', '!= 5.12.0'

eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')
2 changes: 2 additions & 0 deletions spec/support/aruba_support.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module ArubaLoader
extend RSpec::Support::WithIsolatedStdErr
with_isolated_stderr do
# Aruba depends on FFI, but under JRuby it's not loaded for some reason
require 'ffi'
require 'aruba/api'
end
end
Expand Down