diff options
author | Andre Arko <andre@arko.net> | 2013-01-06 17:18:49 -0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2013-01-06 17:18:50 -0800 |
commit | d7f521021069172a09e5fb6be35d1e79fa083572 (patch) | |
tree | e7de137c5456699e2bf6cf4cd47ec2a54092937a | |
parent | bee13e016da1743b149111ace572918e26281b5a (diff) | |
download | bundler-d7f521021069172a09e5fb6be35d1e79fa083572.tar.gz |
distinguish between 1.9 and 2.0 correctly
via @spastorino
-rw-r--r-- | lib/bundler/dependency.rb | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb index 50ac522e16..7f153f236c 100644 --- a/lib/bundler/dependency.rb +++ b/lib/bundler/dependency.rb @@ -81,20 +81,32 @@ module Bundler private + def on_18? + RUBY_VERSION =~ /^1\.8/ + end + + def on_19? + RUBY_VERSION =~ /^1\.9/ + end + + def on_20? + RUBY_VERSION =~ /^2\.0/ + end + def ruby? !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev") end def ruby_18? - ruby? && RUBY_VERSION < "1.9" + ruby? && on_18? end def ruby_19? - ruby? && RUBY_VERSION >= "1.9" + ruby? && on_19? end def ruby_20? - ruby? && RUBY_VERSION >= "2.0" + ruby? && on_20? end def mri? @@ -102,16 +114,16 @@ module Bundler end def mri_18? - mri? && RUBY_VERSION < "1.9" + mri? && on_18? end def mri_19? - mri? && RUBY_VERSION >= "1.9" + mri? && on_19? end def mri_20? - mri? && RUBY_VERSION >= "2.0" + mri? && on_20? end def rbx? @@ -135,15 +147,15 @@ module Bundler end def mingw_18? - mingw? && RUBY_VERSION < "1.9" + mingw? && on_18? end def mingw_19? - mingw? && RUBY_VERSION >= "1.9" + mingw? && on_19? end def mingw_20? - mingw? && RUBY_VERSION >= "2.0" + mingw? && on_20? end end |