diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-11-30 09:50:09 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-11-30 09:50:17 -0600 |
commit | 1f10c7f07fdbe5b664272d54657b5687bc881810 (patch) | |
tree | 3a7a8fc2c7a557492ab1fbccf8709b634df2fc24 | |
parent | 8d7b9e1fbea3c731ea76cf22f2aa854885678127 (diff) | |
download | bundler-seg-rubygems-ignore-missing-exts.tar.gz |
[RubyGems] Old RG compatibility for skipping specs with missing extensionsseg-rubygems-ignore-missing-exts
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 9 | ||||
-rw-r--r-- | lib/bundler/source/rubygems.rb | 4 | ||||
-rw-r--r-- | spec/install/gemfile/git_spec.rb | 6 | ||||
-rw-r--r-- | spec/install/path_spec.rb | 2 |
4 files changed, 13 insertions, 8 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index ec1a408715..8ec9df53e8 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -71,8 +71,13 @@ module Bundler spec.installed_by_version = Gem::Version.create(installed_by_version) end - def spec_missing_extensions?(spec) - !spec.respond_to?(:missing_extensions?) || spec.missing_extensions? + def spec_missing_extensions?(spec, default = true) + return spec.missing_extensions? if spec.respond_to?(:missing_extensions?) + + return false if spec.respond_to?(:default_gem?) && spec.default_gem? + return false if spec.extensions.empty? + + default end def path(obj) diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index b53a939bbc..53d3a84fb0 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -292,7 +292,7 @@ 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? + if Bundler.rubygems.spec_missing_extensions?(spec, false) Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions" next end @@ -326,7 +326,7 @@ module Bundler next if gemfile =~ /^bundler\-[\d\.]+?\.gem/ s ||= Bundler.rubygems.spec_from_gem(gemfile) s.source = self - if s.missing_extensions? + if Bundler.rubygems.spec_missing_extensions?(s, false) Bundler.ui.debug "Source #{self} is ignoring #{s} because it is missing extensions" next end diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index f70ea5b43a..85a7693b5a 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -1022,20 +1022,20 @@ describe "bundle install with git sources" do gem "foo", :git => "#{lib_path("foo-1.0")}" G - run <<-R + run! <<-R require 'foo' puts FOO R installed_time = out - expect(installed_time).to match(/\d+\.\d+/) + expect(installed_time).to match(/\A\d+\.\d+\z/) install_gemfile <<-G source "file://#{gem_repo1}" gem "foo", :git => "#{lib_path("foo-1.0")}" G - run <<-R + run! <<-R require 'foo' puts FOO R diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb index 04eeb2d942..9a8d61ea47 100644 --- a/spec/install/path_spec.rb +++ b/spec/install/path_spec.rb @@ -129,7 +129,7 @@ describe "bundle install" do expect(the_bundle).to include_gems "rack 1.0.0" end - it "re-installs gems whose extensions have been deleted" do + it "re-installs gems whose extensions have been deleted", :rubygems => ">= 2.3" do build_lib "very_simple_binary", "1.0.0", :to_system => true do |s| s.write "lib/very_simple_binary.rb", "raise 'FAIL'" end |