diff options
author | André Arko <mail@arko.net> | 2014-12-14 15:43:07 -0800 |
---|---|---|
committer | André Arko <mail@arko.net> | 2014-12-14 15:43:07 -0800 |
commit | 36f6bd680f04d5b261a8ecf57cec5c79dd28a71d (patch) | |
tree | 2ff210ff3933a1912edb6313072ec00054da4f66 | |
parent | 79ee7ba50380c1cf374e47131273cb9b9cb17caa (diff) | |
parent | e6bc48eb5ffcfd9f208597fc772c75a7b086b3e2 (diff) | |
download | bundler-36f6bd680f04d5b261a8ecf57cec5c79dd28a71d.tar.gz |
Merge pull request #3309 from thomasfedb/ruby_22
Added ruby_22? and friends to CurrentRuby.
-rw-r--r-- | lib/bundler/current_ruby.rb | 60 | ||||
-rw-r--r-- | lib/bundler/dependency.rb | 1 | ||||
-rw-r--r-- | man/gemfile.5.ronn | 2 | ||||
-rw-r--r-- | spec/cache/platform_spec.rb | 4 |
4 files changed, 65 insertions, 2 deletions
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb index 8d012a03d7..ca601d111f 100644 --- a/lib/bundler/current_ruby.rb +++ b/lib/bundler/current_ruby.rb @@ -23,6 +23,10 @@ module Bundler RUBY_VERSION =~ /^2\.1/ end + def on_22? + RUBY_VERSION =~ /^2\.2/ + end + def ruby? !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev") end @@ -43,6 +47,10 @@ module Bundler ruby? && on_21? end + def ruby_22? + ruby? && on_22? + end + def mri? !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby") end @@ -63,6 +71,10 @@ module Bundler mri? && on_21? end + def mri_22? + mri? && on_22? + end + def rbx? ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx" end @@ -87,6 +99,46 @@ module Bundler Bundler::WINDOWS end + def mswin_18? + mswin? && on_18? + end + + def mswin_19? + mswin? && on_19? + end + + def mswin_20? + mswin? && on_20? + end + + def mswin_21? + mswin? && on_21? + end + + def mswin_22? + mswin? && on_22? + end + + def mswin64? + Bundler::WINDOWS && Gem::Platform.local.os == "mswin64" && Gem::Platform.local.cpu == 'x64' + end + + def mswin64_19? + mswin64? && on_19? + end + + def mswin64_20? + mswin64? && on_20? + end + + def mswin64_21? + mswin64? && on_21? + end + + def mswin64_22? + mswin64? && on_22? + end + def mingw? Bundler::WINDOWS && Gem::Platform.local.os == "mingw32" && Gem::Platform.local.cpu != 'x64' end @@ -107,6 +159,10 @@ module Bundler mingw? && on_21? end + def mingw_22? + mingw? && on_22? + end + def x64_mingw? Bundler::WINDOWS && Gem::Platform.local.os == "mingw32" && Gem::Platform.local.cpu == 'x64' end @@ -119,5 +175,9 @@ module Bundler x64_mingw? && on_21? end + def x64_mingw_22? + x64_mingw? && on_22? + end + end end diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb index c0e8f8bf7b..675e2fb9fe 100644 --- a/lib/bundler/dependency.rb +++ b/lib/bundler/dependency.rb @@ -14,6 +14,7 @@ module Bundler :ruby_19 => Gem::Platform::RUBY, :ruby_20 => Gem::Platform::RUBY, :ruby_21 => Gem::Platform::RUBY, + :ruby_22 => Gem::Platform::RUBY, :mri => Gem::Platform::RUBY, :mri_18 => Gem::Platform::RUBY, :mri_19 => Gem::Platform::RUBY, diff --git a/man/gemfile.5.ronn b/man/gemfile.5.ronn index ac49f8c08d..e84c0f5228 100644 --- a/man/gemfile.5.ronn +++ b/man/gemfile.5.ronn @@ -181,6 +181,8 @@ There are a number of `Gemfile` platforms: _ruby_ `AND` version 2.0 * `ruby_21`: _ruby_ `AND` version 2.1 + * `ruby_22`: + _ruby_ `AND` version 2.2 * `mri`: Same as _ruby_, but not Rubinius * `mri_18`: diff --git a/spec/cache/platform_spec.rb b/spec/cache/platform_spec.rb index 0ced66375f..0701d5d4fb 100644 --- a/spec/cache/platform_spec.rb +++ b/spec/cache/platform_spec.rb @@ -5,7 +5,7 @@ describe "bundle cache with multiple platforms" do gemfile <<-G source "file://#{gem_repo1}" - platforms :ruby, :ruby_18, :ruby_19, :ruby_20, :ruby_21 do + platforms :ruby, :ruby_18, :ruby_19, :ruby_20, :ruby_21, :ruby_22 do gem "rack", "1.0.0" end @@ -13,7 +13,7 @@ describe "bundle cache with multiple platforms" do gem "activesupport", "2.3.5" end - platforms :mri, :mri_18, :mri_19, :mri_20, :mri_21 do + platforms :mri, :mri_18, :mri_19, :mri_20, :mri_21, :mri_22 do gem "activerecord", "2.3.2" end G |