summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-06-13 13:43:13 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-06-14 10:37:11 -0500
commitce0bf5987777ef16ed703e84368db5a0c88c2fb8 (patch)
tree6f02bd3e51c2bbdc0f0b861a45afd318a227c6cd
parent0560c9c673f5792f002265ed88987b83685168d5 (diff)
downloadbundler-seg-load-path-gem-plugins.tar.gz
Ensure that diff/lcs is loaded in the specsseg-load-path-gem-plugins
-rw-r--r--lib/bundler/installer.rb7
-rw-r--r--spec/spec_helper.rb1
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index b5d528d865..ae8055408f 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -174,7 +174,12 @@ module Bundler
requested_path_gems = @definition.requested_specs.select {|s| s.source.is_a?(Source::Path) }
path_plugin_files = requested_path_gems.map do |spec|
- Bundler.rubygems.spec_matches_for_glob(spec, "rubygems_plugin#{Bundler.rubygems.suffix_pattern}")
+ begin
+ Bundler.rubygems.spec_matches_for_glob(spec, "rubygems_plugin#{Bundler.rubygems.suffix_pattern}")
+ rescue TypeError
+ error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
+ raise Gem::InvalidSpecificationException, error_message
+ end
end.flatten
Bundler.rubygems.load_plugin_files(path_plugin_files)
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index f9285463b5..f6700ca315 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -13,6 +13,7 @@ begin
rspec = spec.dependencies.find {|d| d.name == "rspec" }
gem "rspec", rspec.requirement.to_s
require "rspec"
+ require "diff/lcs"
rescue LoadError
abort "Run rake spec:deps to install development dependencies"
end