summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-11-29 19:01:37 -0600
committerSamuel Giddins <segiddins@segiddins.me>2016-11-30 09:50:17 -0600
commit8d7b9e1fbea3c731ea76cf22f2aa854885678127 (patch)
treede14e30b6ad480fe1fbb5d3e7fd43bc31f418376
parentb567a9130b38ea1c65c93eef879edd54ae386596 (diff)
downloadbundler-8d7b9e1fbea3c731ea76cf22f2aa854885678127.tar.gz
[RubyGems] Ignore specs missing extensions
-rw-r--r--lib/bundler/source/rubygems.rb8
-rw-r--r--spec/install/path_spec.rb28
2 files changed, 36 insertions, 0 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 89f7673eb8..b53a939bbc 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -292,6 +292,10 @@ module Bundler
next if spec.name == "bundler" && spec.version.to_s != VERSION
have_bundler = true if spec.name == "bundler"
spec.source = self
+ if spec.missing_extensions?
+ Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
+ next
+ end
idx << spec
end
@@ -322,6 +326,10 @@ module Bundler
next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
s ||= Bundler.rubygems.spec_from_gem(gemfile)
s.source = self
+ if s.missing_extensions?
+ Bundler.ui.debug "Source #{self} is ignoring #{s} because it is missing extensions"
+ next
+ end
idx << s
end
end
diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb
index 0a961981b3..04eeb2d942 100644
--- a/spec/install/path_spec.rb
+++ b/spec/install/path_spec.rb
@@ -128,6 +128,34 @@ describe "bundle install" do
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
expect(the_bundle).to include_gems "rack 1.0.0"
end
+
+ it "re-installs gems whose extensions have been deleted" do
+ build_lib "very_simple_binary", "1.0.0", :to_system => true do |s|
+ s.write "lib/very_simple_binary.rb", "raise 'FAIL'"
+ end
+
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "very_simple_binary"
+ G
+
+ bundle "install --path ./vendor/bundle"
+
+ expect(vendored_gems("gems/very_simple_binary-1.0")).to be_directory
+ expect(vendored_gems("extensions")).to be_directory
+ expect(the_bundle).to include_gems "very_simple_binary 1.0", :source => "remote1"
+
+ vendored_gems("extensions").rmtree
+
+ run "require 'very_simple_binary_c'"
+ expect(err).to include("Bundler::GemNotFound")
+
+ bundle "install --path ./vendor/bundle"
+
+ expect(vendored_gems("gems/very_simple_binary-1.0")).to be_directory
+ expect(vendored_gems("extensions")).to be_directory
+ expect(the_bundle).to include_gems "very_simple_binary 1.0", :source => "remote1"
+ end
end
describe "to a file" do