diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-06-21 19:09:43 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-06-22 11:49:00 -0500 |
commit | bd626995442707e5f114fabccc1b434ab0ad2ff0 (patch) | |
tree | 1304e215ed12b01a086ac74cd53d8ca9c921a55a | |
parent | 67ff76af19e6d033d26e63ff2f064754316fee38 (diff) | |
download | bundler-bd626995442707e5f114fabccc1b434ab0ad2ff0.tar.gz |
Allow not having specs available for gems that won’t be installed
-rw-r--r-- | lib/bundler/definition.rb | 7 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 2 | ||||
-rw-r--r-- | spec/install/gemfile/groups_spec.rb | 4 | ||||
-rw-r--r-- | spec/install/git_spec.rb | 8 |
4 files changed, 10 insertions, 11 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 0e39cf710c..51179c61d3 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -167,8 +167,7 @@ module Bundler "to a different version of #{locked_gem} that hasn't been removed in order to install." end unless specs["bundler"].any? - local = Bundler.settings[:frozen] ? rubygems_index : index - bundler = local.search(Gem::Dependency.new("bundler", VERSION)).last + bundler = rubygems_index.search(Gem::Dependency.new("bundler", VERSION)).last specs["bundler"] = bundler if bundler end @@ -194,9 +193,9 @@ module Bundler missing end - def missing_dependencies? + def missing_specs? missing = [] - resolve.materialize(current_dependencies, missing) + resolve.materialize(requested_dependencies, missing) return false if missing.empty? Bundler.ui.debug "The definition is missing #{missing.map(&:full_name)}" true diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 7c13c0c8a9..8775fe2ed0 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -231,7 +231,7 @@ module Bundler def resolve_if_needed(options) if !options["update"] && !options[:inline] && !options["force"] && Bundler.default_lockfile.file? - return if @definition.nothing_changed? && !@definition.missing_dependencies? + return if @definition.nothing_changed? && !@definition.missing_specs? end options["local"] ? @definition.resolve_with_cache! : @definition.resolve_remotely! diff --git a/spec/install/gemfile/groups_spec.rb b/spec/install/gemfile/groups_spec.rb index a6b81d0911..ed264d8439 100644 --- a/spec/install/gemfile/groups_spec.rb +++ b/spec/install/gemfile/groups_spec.rb @@ -363,8 +363,8 @@ RSpec.describe "bundle install with groups" do it "does not hit the remote a second time" do FileUtils.rm_rf gem_repo2 - bundle "install --without rack" - expect(err).to lack_errors + bundle! "install --without rack" + expect(out).not_to include "Fetching" end end end diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index cd3b6e6a88..75d70747da 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -36,8 +36,8 @@ RSpec.describe "bundle install" do expect(the_bundle).to include_gems "foo 2.0", :source => "git@#{lib_path("foo")}" end - it "should check out git repos that are missing but not being installed" do - build_git "foo" + it "should allows git repos that are missing but not being installed" do + revision = build_git("foo").ref_for("HEAD") gemfile <<-G gem "foo", :git => "file://#{lib_path("foo-1.0")}", :group => :development @@ -46,6 +46,7 @@ RSpec.describe "bundle install" do lockfile <<-L GIT remote: file://#{lib_path("foo-1.0")} + revision: #{revision} specs: foo (1.0) @@ -56,10 +57,9 @@ RSpec.describe "bundle install" do foo! L - bundle "install --path=vendor/bundle --without development" + bundle! "install --path=vendor/bundle --without development" expect(out).to include("Bundle complete!") - expect(vendored_gems("bundler/gems/foo-1.0-#{revision_for(lib_path("foo-1.0"))[0..11]}")).to be_directory end end end |