Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Added ruby_22? and friends to CurrentRuby. #3309

Merged
merged 1 commit into from
Dec 14, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions lib/bundler/current_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def on_21?
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
Expand All @@ -43,6 +47,10 @@ def ruby_21?
ruby? && on_21?
end

def ruby_22?
ruby? && on_22?
end

def mri?
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
end
Expand All @@ -63,6 +71,10 @@ def mri_21?
mri? && on_21?
end

def mri_22?
mri? && on_22?
end

def rbx?
ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
end
Expand All @@ -87,6 +99,46 @@ def mswin?
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
Expand All @@ -107,6 +159,10 @@ def mingw_21?
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
Expand All @@ -119,5 +175,9 @@ def x64_mingw_21?
x64_mingw? && on_21?
end

def x64_mingw_22?
x64_mingw? && on_22?
end

end
end
1 change: 1 addition & 0 deletions lib/bundler/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Dependency < Gem::Dependency
:ruby_19 => Gem::Platform::RUBY,
:ruby_20 => Gem::Platform::RUBY,
:ruby_21 => Gem::Platform::RUBY,
:ruby_22 => Gem::Platform::RUBY,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like mri_22 was omitted here. #3328 should address this.

:mri => Gem::Platform::RUBY,
:mri_18 => Gem::Platform::RUBY,
:mri_19 => Gem::Platform::RUBY,
Expand Down
2 changes: 2 additions & 0 deletions man/gemfile.5.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
4 changes: 2 additions & 2 deletions spec/cache/platform_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
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

platforms :jruby 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
Expand Down