diff options
author | James Wen <jrw2175@columbia.edu> | 2016-02-27 00:13:43 -0500 |
---|---|---|
committer | James Wen <jrw2175@columbia.edu> | 2016-02-27 00:13:43 -0500 |
commit | 483bd8ee8da279fbf93a3b02a4d5dfc6f6acaf2a (patch) | |
tree | 48f3cda5c72a986e83b48a90f7ea028529cbb5c4 /lib | |
parent | f819834287274aa78d0fd03ac5685cf543cd68e4 (diff) | |
download | bundler-483bd8ee8da279fbf93a3b02a4d5dfc6f6acaf2a.tar.gz |
Allow `Bundler::RubyVersion` to handle `RUBY_PATCHLEVEL` of -1
- Closes #4317
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/ruby_version.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bundler/ruby_version.rb b/lib/bundler/ruby_version.rb index 800a4433..92f9d4c3 100644 --- a/lib/bundler/ruby_version.rb +++ b/lib/bundler/ruby_version.rb @@ -103,6 +103,9 @@ module Bundler private def matches?(requirements, version) + # Handles RUBY_PATCHLEVEL of -1 for instances like ruby-head + return requirements == version if requirements.to_s == "-1" || version.to_s == "-1" + Array(requirements).all? do |requirement| Gem::Requirement.create(requirement).satisfied_by?(Gem::Version.create(version)) end |