summaryrefslogtreecommitdiff
path: root/lib/bundler/installer
diff options
context:
space:
mode:
authorJames Wen <jrw2175@columbia.edu>2016-02-05 01:16:37 -0500
committerJames Wen <jrw2175@columbia.edu>2016-02-07 16:20:25 -0500
commitcb29f676c16cb2eab36b7dc3f22caea0754f9e74 (patch)
tree4d55235ec4cb2ed5352cd9467fc0496edfcbd1e1 /lib/bundler/installer
parent661a2d392346094ffbc671d8dbb2e10710f02dbe (diff)
downloadbundler-cb29f676c16cb2eab36b7dc3f22caea0754f9e74.tar.gz
Add helpful invalid gemspec error message for `bundle install
--standalone` when a gem/dependency has an invalid gemspec
Diffstat (limited to 'lib/bundler/installer')
-rw-r--r--lib/bundler/installer/standalone.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bundler/installer/standalone.rb b/lib/bundler/installer/standalone.rb
index 69cfbfc455..41fe207756 100644
--- a/lib/bundler/installer/standalone.rb
+++ b/lib/bundler/installer/standalone.rb
@@ -44,6 +44,9 @@ module Bundler
def gem_path(path, spec)
full_path = Pathname.new(path).absolute? ? path : File.join(spec.full_gem_path, path)
Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
+ rescue TypeError
+ error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
+ raise Gem::InvalidSpecificationException.new(error_message)
end
end
end