summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-06-09 17:08:48 -0400
committerAndre Arko <andre@arko.net>2010-06-09 17:08:48 -0400
commit4e26209902d0ee3ba635de74c411dd0ec0c7035d (patch)
tree4fc4067bcfd5027d1d99e30a90d0250157abdda5
parent032cbd05988c5a1d4b4a8c56f7e3769569a5c232 (diff)
downloadbundler-4e26209902d0ee3ba635de74c411dd0ec0c7035d.tar.gz
Rescue Zlib errors and print a useful message
-rw-r--r--lib/bundler/source.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index efa15a47f9..34a68fde1c 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -146,7 +146,11 @@ module Bundler
index = Index.new
Dir["#{@path}/*.gem"].each do |gemfile|
- spec = Gem::Format.from_file_by_path(gemfile).spec
+ begin
+ spec = Gem::Format.from_file_by_path(gemfile).spec
+ rescue Zlib::GzipFile::Error
+ raise GemspecError, "Zlib error while reading #{gemfile}. Chances are good that it is corrupted, and you need to delete it."
+ end
next unless Gem::Platform.match(spec.platform)
spec.source = self
index << spec