summaryrefslogtreecommitdiff
path: root/lib/bundler/ruby_version.rb
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-06-27 20:34:47 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-06-27 20:34:47 -0500
commitbc5f8817c167c3005ca8bc0930c1261d56af9f2e (patch)
treef3ac184f49671d6ee102eb52a9059ea24f9c3a32 /lib/bundler/ruby_version.rb
parent58fc66897b156ce91eb98710f7708f8abe36c806 (diff)
downloadbundler-bc5f8817c167c3005ca8bc0930c1261d56af9f2e.tar.gz
[RubyVersion] Fix running when patch < 0seg-ruby-head-specs
Diffstat (limited to 'lib/bundler/ruby_version.rb')
-rw-r--r--lib/bundler/ruby_version.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundler/ruby_version.rb b/lib/bundler/ruby_version.rb
index d0e9c50af2..9321f94c23 100644
--- a/lib/bundler/ruby_version.rb
+++ b/lib/bundler/ruby_version.rb
@@ -42,7 +42,7 @@ module Bundler
PATTERN = /
ruby\s
([\d.]+) # ruby version
- (?:p(\d+))? # optional patchlevel
+ (?:p(-?\d+))? # optional patchlevel
(?:\s\((\S+)\s(.+)\))? # optional engine info
/xo
@@ -115,7 +115,9 @@ module Bundler
else
raise BundlerError, "RUBY_ENGINE value #{RUBY_ENGINE} is not recognized"
end
- @ruby_version ||= RubyVersion.new(ruby_version, RUBY_PATCHLEVEL.to_s, ruby_engine, ruby_engine_version)
+ patchlevel = RUBY_PATCHLEVEL.to_s
+
+ @ruby_version ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
end
def to_gem_version_with_patchlevel