diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-01-23 17:00:04 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-01-23 17:00:04 -0600 |
commit | 38ff42708f5a8d176f66a70d705e513da4a7c5b5 (patch) | |
tree | db68ec83849580a3d2a44704dba916fafda9408c | |
parent | 2aef2700d44d3af0f68c63e58dd57fc126fec054 (diff) | |
download | bundler-38ff42708f5a8d176f66a70d705e513da4a7c5b5.tar.gz |
[Definition] Avoid re-resolving when a gemspec has dev depsseg-gemspec-dev-deps-no-resolve
-rw-r--r-- | lib/bundler/definition.rb | 3 | ||||
-rw-r--r-- | spec/install/gemfile/gemspec_spec.rb | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 15383a22c5..1e13794ae7 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -691,7 +691,8 @@ module Bundler dep.platforms.concat(@platforms.map {|p| Dependency::REVERSE_PLATFORM_MAP[p] }.flatten(1)).uniq! end end - Set.new(@dependencies) != Set.new(@locked_deps) + dependency_without_type = proc {|d| Gem::Dependency.new(d.name, *d.requirement.as_list) } + Set.new(@dependencies.map(&dependency_without_type)) != Set.new(@locked_deps.map(&dependency_without_type)) end # Remove elements from the locked specs that are expired. This will most diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb index 1972bfe236..4b8e4d6f96 100644 --- a/spec/install/gemfile/gemspec_spec.rb +++ b/spec/install/gemfile/gemspec_spec.rb @@ -145,6 +145,23 @@ RSpec.describe "bundle install from an existing gemspec" do expect(out).to include("Found no changes, using resolution from the lockfile") end + it "should match a lockfile without needing to re-resolve with development dependencies" do + simulate_platform java + + build_lib("foo", :path => tmp.join("foo")) do |s| + s.add_dependency "rack" + s.add_development_dependency "thin" + end + + install_gemfile! <<-G + source "file://#{gem_repo1}" + gemspec :path => '#{tmp.join("foo")}' + G + + bundle! "install", :verbose => true + expect(out).to include("Found no changes, using resolution from the lockfile") + end + it "should evaluate the gemspec in its directory" do build_lib("foo", :path => tmp.join("foo")) File.open(tmp.join("foo/foo.gemspec"), "w") do |s| |