Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ruby 2.0+ should have platform definitions

Added `:ruby_20`, `:mri_20` and `:mingw_20`
Also made same fix to `mingw_19?` as #1539 -- 19 is not 20.
  • Loading branch information...
commit 9fcbc25c49c9b83ef8cd543f07bec8497f5945a1 1 parent 3a1121a
Philip (flip) Kromer authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 lib/bundler/dependency.rb
View
16 lib/bundler/dependency.rb
@@ -12,9 +12,11 @@ class Dependency < Gem::Dependency
:ruby => Gem::Platform::RUBY,
:ruby_18 => Gem::Platform::RUBY,
:ruby_19 => Gem::Platform::RUBY,
+ :ruby_20 => Gem::Platform::RUBY,
:mri => Gem::Platform::RUBY,
:mri_18 => Gem::Platform::RUBY,
:mri_19 => Gem::Platform::RUBY,
+ :mri_20 => Gem::Platform::RUBY,
:rbx => Gem::Platform::RUBY,
:jruby => Gem::Platform::JAVA,
:mswin => Gem::Platform::MSWIN,
@@ -90,6 +92,10 @@ def ruby_19?
ruby? && RUBY_VERSION >= "1.9" && RUBY_VERSION < "2.0"
end
+ def ruby_19?
+ ruby? && RUBY_VERSION >= "2.0" && RUBY_VERSION < "3.0"
+ end
+
def mri?
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
end
@@ -101,6 +107,10 @@ def mri_18?
def mri_19?
mri? && RUBY_VERSION >= "1.9" && RUBY_VERSION < "2.0"
end
+
+ def mri_20?
+ mri? && RUBY_VERSION >= "2.0" && RUBY_VERSION < "3.0"
+ end
def rbx?
ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
@@ -127,7 +137,11 @@ def mingw_18?
end
def mingw_19?
- mingw? && RUBY_VERSION >= "1.9"
+ mingw? && RUBY_VERSION >= "1.9" && RUBY_VERSION < "2.0"
+ end
+
+ def mingw_20?
+ mingw? && RUBY_VERSION >= "2.0" && RUBY_VERSION < "3.0"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.