diff options
author | Andre Arko <andre@arko.net> | 2012-11-29 18:24:43 -0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2012-11-29 18:24:43 -0800 |
commit | 2b6e63cd0b2a179a4c4985b4e3d0701aa3ade0a0 (patch) | |
tree | c5a952bdbaaddc4114f5b7d94178aac207a0b79a | |
parent | f1958b16f6826e5d14745dbf26c15efbe0113df9 (diff) | |
download | bundler-2b6e63cd0b2a179a4c4985b4e3d0701aa3ade0a0.tar.gz |
fix ensure to sanity-check its actions
-rw-r--r-- | lib/bundler/source/path.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index 05aa65fb8d..2ae8f12d2b 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -193,7 +193,9 @@ module Bundler Bundler.ui.warn "The validation message from Rubygems was:\n #{e.message}" ensure - Dir.chdir(gem_dir){ FileUtils.rm_rf(gem_file) if gem_file && File.exist?(gem_file) } + if gem_dir && gem_file && File.exist?(gem_file) + Dir.chdir(gem_dir){ FileUtils.rm_rf(gem_file) } + end end def run_hooks(type, installer) |