diff options
author | Terence Lee <hone02@gmail.com> | 2011-11-30 13:36:33 -0600 |
---|---|---|
committer | Terence Lee <hone02@gmail.com> | 2011-11-30 13:55:08 -0600 |
commit | 8b5c9b39c4c160d84e2d9b02f844a2ba3bd3abcb (patch) | |
tree | 4e1a28356d1bd6f5aa774bb6dcd392b7190bc80a | |
parent | 403e7c20070d504e6a805e01242ded83a9cb2e4d (diff) | |
download | bundler-8b5c9b39c4c160d84e2d9b02f844a2ba3bd3abcb.tar.gz |
#1473 fix bundle clean output for git repos
-rw-r--r-- | lib/bundler/runtime.rb | 5 | ||||
-rw-r--r-- | spec/other/clean_spec.rb | 30 |
2 files changed, 17 insertions, 18 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index 09a1597d..efa4507d 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -185,10 +185,9 @@ module Bundler FileUtils.rm_rf(gem_dir) parts = full_name.split('-') - name = parts[0..-3].join('-') + name = parts[0..-2].join('-') revision = parts[-1] - version = parts[-2] - output = "#{name} (#{version} #{revision})" + output = "#{name} (#{revision})" Bundler.ui.info "Removing #{output}" diff --git a/spec/other/clean_spec.rb b/spec/other/clean_spec.rb index b9c648ad..12939bbc 100644 --- a/spec/other/clean_spec.rb +++ b/spec/other/clean_spec.rb @@ -146,9 +146,9 @@ describe "bundle clean" do end it "removes unused git gems" do - build_git "foo" - revision = revision_for(lib_path("foo-1.0")) - git_path = lib_path('foo-1.0') + build_git "foo", :path => lib_path("foo") + git_path = lib_path('foo') + revision = revision_for(git_path) gemfile <<-G source "file://#{gem_repo1}" @@ -170,12 +170,12 @@ describe "bundle clean" do bundle :clean - out.should eq("Removing foo (1.0 #{revision[0..11]})") + out.should eq("Removing foo (#{revision[0..11]})") vendored_gems("gems/rack-1.0.0").should exist - vendored_gems("bundler/gems/foo-1.0-#{revision[0..11]}").should_not exist + vendored_gems("bundler/gems/foo-#{revision[0..11]}").should_not exist digest = Digest::SHA1.hexdigest(git_path.to_s) - vendored_gems("cache/bundler/git/foo-1.0-#{digest}").should_not exist + vendored_gems("cache/bundler/git/foo-#{digest}").should_not exist vendored_gems("specifications/rack-1.0.0.gemspec").should exist @@ -183,31 +183,31 @@ describe "bundle clean" do end it "removes old git gems" do - build_git "foo" - revision = revision_for(lib_path("foo-1.0")) + build_git "foo-bar", :path => lib_path("foo-bar") + revision = revision_for(lib_path("foo-bar")) gemfile <<-G source "file://#{gem_repo1}" gem "rack", "1.0.0" - git "#{lib_path('foo-1.0')}" do - gem "foo" + git "#{lib_path('foo-bar')}" do + gem "foo-bar" end G bundle "install --path vendor/bundle --no-clean" - update_git "foo" - revision2 = revision_for(lib_path("foo-1.0")) + update_git "foo", :path => lib_path("foo-bar") + revision2 = revision_for(lib_path("foo-bar")) bundle "update --no-clean" bundle :clean - out.should eq("Removing foo (1.0 #{revision[0..11]})") + out.should eq("Removing foo-bar (#{revision[0..11]})") vendored_gems("gems/rack-1.0.0").should exist - vendored_gems("bundler/gems/foo-1.0-#{revision[0..11]}").should_not exist - vendored_gems("bundler/gems/foo-1.0-#{revision2[0..11]}").should exist + vendored_gems("bundler/gems/foo-bar-#{revision[0..11]}").should_not exist + vendored_gems("bundler/gems/foo-bar-#{revision2[0..11]}").should exist vendored_gems("specifications/rack-1.0.0.gemspec").should exist |