summaryrefslogtreecommitdiff
path: root/lib/bundler/current_ruby.rb
diff options
context:
space:
mode:
authorBrandon Black <brandonmblack@gmail.com>2013-09-24 17:52:46 -0700
committerBrandon Black <brandonmblack@gmail.com>2013-09-24 17:59:32 -0700
commit7ebc2f7f20cdf40d5fc2893d269896b4f8245865 (patch)
tree20b9828b47cecb63f88821e0bb5584951083cae6 /lib/bundler/current_ruby.rb
parent5b09da434bb5cf6209e13ad43cfb035bdc7c7f0b (diff)
downloadbundler-7ebc2f7f20cdf40d5fc2893d269896b4f8245865.tar.gz
adding platform support for ruby 2.1
* added new platform and ruby version helpers * updated man file and tests
Diffstat (limited to 'lib/bundler/current_ruby.rb')
-rw-r--r--lib/bundler/current_ruby.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb
index c35f55036c..ae075d3456 100644
--- a/lib/bundler/current_ruby.rb
+++ b/lib/bundler/current_ruby.rb
@@ -19,6 +19,10 @@ module Bundler
RUBY_VERSION =~ /^2\.0/
end
+ def on_21?
+ RUBY_VERSION =~ /^2\.1/
+ end
+
def ruby?
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev")
end
@@ -35,6 +39,10 @@ module Bundler
ruby? && on_20?
end
+ def ruby_21?
+ ruby? && on_21?
+ end
+
def mri?
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
end
@@ -47,11 +55,14 @@ module Bundler
mri? && on_19?
end
-
def mri_20?
mri? && on_20?
end
+ def mri_21?
+ mri? && on_21?
+ end
+
def rbx?
ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
end
@@ -84,6 +95,10 @@ module Bundler
mingw? && on_20?
end
+ def mingw_21?
+ mingw? && on_21?
+ end
+
def x64_mingw?
Bundler::WINDOWS && Gem::Platform.local.os == "mingw32" && Gem::Platform.local.cpu == 'x64'
end
@@ -92,5 +107,9 @@ module Bundler
x64_mingw? && on_20?
end
+ def x64_mingw_21?
+ x64_mingw? && on_21?
+ end
+
end
end