Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Don't check development dependencies when unlocking locked gems in a …
Browse files Browse the repository at this point in the history
…path source
  • Loading branch information
carllerche committed Feb 13, 2011
1 parent 0527f48 commit 87b74d9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/bundler/definition.rb
Expand Up @@ -367,8 +367,10 @@ def converge_locked_specs
# If the spec is no longer in the path source, unlock it. This
# commonly happens if the version changed in the gemspec
next unless other

deps2 = other.dependencies.select { |d| d.type != :development }
# If the dependencies of the path source have changed, unlock it
next unless s.dependencies.sort == other.dependencies.sort
next unless s.dependencies.sort == deps2.sort
end

converged << s
Expand Down
21 changes: 21 additions & 0 deletions spec/install/path_spec.rb
Expand Up @@ -161,6 +161,27 @@
should_be_installed "rack 1.0"
end

it "doesn't automatically unlock dependencies when using the gemspec syntax and the gem has development dependencies" do
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
s.add_dependency "rack", ">= 1.0"
s.add_development_dependency "activesupport"
end

Dir.chdir lib_path("foo")

install_gemfile lib_path("foo/Gemfile"), <<-G
source "file://#{gem_repo1}"
gemspec
G

build_gem "rack", "1.0.1", :to_system => true

bundle "install"

should_be_installed "foo 1.0"
should_be_installed "rack 1.0"
end

it "raises if there are multiple gemspecs" do
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
s.write "bar.gemspec"
Expand Down

0 comments on commit 87b74d9

Please sign in to comment.