From a6994c7d0866853c08b68458222af2dec718bc0a Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Sun, 18 Apr 2010 09:48:32 -0700 Subject: [PATCH] Remove generated .gem files after installing a gem from a :path Closes #286 --- lib/bundler/source.rb | 2 ++ spec/install/path_spec.rb | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 71f56ca478f..461b6b9d7b2 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -278,6 +278,8 @@ def generate_bin(spec) end Bundler.ui.warn "The validation message from Rubygems was:\n #{e.message}" + ensure + Dir.chdir(gem_dir){ FileUtils.rm_rf(File.join(gem_dir, gem_file)) } end end diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb index 4a4c125076d..7ab1c140ab4 100644 --- a/spec/install/path_spec.rb +++ b/spec/install/path_spec.rb @@ -84,7 +84,7 @@ should_be_installed "foo 1.0" end - it "setups up executables" do + it "sets up executables" do pending_jruby_shebang_fix build_lib "foo" do |s| @@ -100,6 +100,16 @@ out.should == "1.0" end + it "removes the .gem file after installing" do + build_lib "foo" + + install_gemfile <<-G + gem 'foo', :path => "#{lib_path('foo-1.0')}" + G + + lib_path('foo-1.0').join('foo-1.0.gem').should_not exist + end + describe "block syntax" do it "pulls all gems from a path block" do build_lib "omg"