Skip to content

Commit

Permalink
Ruby 2.0+ should have platform definitions
Browse files Browse the repository at this point in the history
Added `:ruby_20`, `:mri_20` and `:mingw_20`
Also made same fix to `mingw_19?` as rubygems#1539 -- 19 is not 20.
  • Loading branch information
Philip (flip) Kromer committed Aug 13, 2012
1 parent 3a1121a commit 9fcbc25
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/bundler/dependency.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ class Dependency < Gem::Dependency
:ruby => Gem::Platform::RUBY, :ruby => Gem::Platform::RUBY,
:ruby_18 => Gem::Platform::RUBY, :ruby_18 => Gem::Platform::RUBY,
:ruby_19 => Gem::Platform::RUBY, :ruby_19 => Gem::Platform::RUBY,
:ruby_20 => Gem::Platform::RUBY,
:mri => Gem::Platform::RUBY, :mri => Gem::Platform::RUBY,
:mri_18 => Gem::Platform::RUBY, :mri_18 => Gem::Platform::RUBY,
:mri_19 => Gem::Platform::RUBY, :mri_19 => Gem::Platform::RUBY,
:mri_20 => Gem::Platform::RUBY,
:rbx => Gem::Platform::RUBY, :rbx => Gem::Platform::RUBY,
:jruby => Gem::Platform::JAVA, :jruby => Gem::Platform::JAVA,
:mswin => Gem::Platform::MSWIN, :mswin => Gem::Platform::MSWIN,
Expand Down Expand Up @@ -90,6 +92,10 @@ def ruby_19?
ruby? && RUBY_VERSION >= "1.9" && RUBY_VERSION < "2.0" ruby? && RUBY_VERSION >= "1.9" && RUBY_VERSION < "2.0"
end end


def ruby_19?
ruby? && RUBY_VERSION >= "2.0" && RUBY_VERSION < "3.0"
end

def mri? def mri?
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby") !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
end end
Expand All @@ -101,6 +107,10 @@ def mri_18?
def mri_19? def mri_19?
mri? && RUBY_VERSION >= "1.9" && RUBY_VERSION < "2.0" mri? && RUBY_VERSION >= "1.9" && RUBY_VERSION < "2.0"
end end

def mri_20?
mri? && RUBY_VERSION >= "2.0" && RUBY_VERSION < "3.0"
end


def rbx? def rbx?
ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx" ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
Expand All @@ -127,7 +137,11 @@ def mingw_18?
end end


def mingw_19? 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


end end
Expand Down

0 comments on commit 9fcbc25

Please sign in to comment.