diff options
author | Homu <homu@barosl.com> | 2016-05-16 10:46:44 +0900 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-05-16 15:35:57 -0500 |
commit | 4974c4c806842c56856a90061875d4b8a17263e4 (patch) | |
tree | 24cb594e5077555f418870ca6ce18d45bb8e8a05 | |
parent | 0833884b0a83eef06092ead951fb48714e2c6cc1 (diff) | |
download | bundler-4974c4c806842c56856a90061875d4b8a17263e4.tar.gz |
Auto merge of #4386 - bundler:seg-fix-dash-pre, r=segiddins
[Git] Fix checking for equality when a version includes a -
Closes #4385.
-rw-r--r-- | lib/bundler/source/git.rb | 2 | ||||
-rw-r--r-- | spec/commands/show_spec.rb | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index 228ab61a67..f0594c6555 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -25,7 +25,7 @@ module Bundler @ref = options["ref"] || options["branch"] || options["tag"] || "master" @submodules = options["submodules"] @name = options["name"] - @version = options["version"] + @version = options["version"].to_s.strip.gsub("-", ".pre.") @copied = false @local = false diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 7cfa02d418..43bbc3f945 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -110,6 +110,17 @@ describe "bundle show" do bundle :show expect(out).to include("foo (1.0 #{sha[0..6]})") end + + it "handles when a version is a '-' prerelease", :rubygems => "2.1" do + @git = build_git("foo", "1.0.0-beta.1", :path => lib_path("foo")) + install_gemfile <<-G + gem "foo", "1.0.0-beta.1", :git => "#{lib_path("foo")}" + G + should_be_installed "foo 1.0.0.pre.beta.1" + + bundle! :show + expect(out).to include("foo (1.0.0.pre.beta.1") + end end context "in a fresh gem in a blank git repo" do |