Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure the entire dependency chain is installed.

git-svn-id: http://rubygems.rubyforge.org/svn/trunk@1785 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information...
commit 7eea6b6f2422813c425447ec6abffcdd4140bc80 1 parent 2aaea35
drbrain authored
View
5 ChangeLog
@@ -1,3 +1,8 @@
+2008-06-19 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/dependency_installer.rb: Ensure that the entire
+ dependency chain is installed. Fixes bug reported by Chad Wooley.
+
2008-06-18 Eric Hodel <drbrain@segment7.net>
* lib/rubygems/commands/dependency_command.rb: Restore matching
View
5 lib/rubygems/dependency_installer.rb
@@ -133,7 +133,9 @@ def gather_dependencies
deps.each do |dep|
results = find_gems_with_sources(dep).reverse
- results.reject! do
+ results.reject! do |dep_spec,|
+ to_do.push dep_spec
+
@source_index.any? do |_, installed_spec|
dep.name == installed_spec.name and
dep.version_requirements.satisfied_by? installed_spec.version
@@ -144,7 +146,6 @@ def gather_dependencies
next if seen[dep_spec.name]
@specs_and_sources << [dep_spec, source_uri]
dependency_list.add dep_spec
- to_do.push dep_spec
end
end
end
View
25 test/test_gem_dependency_installer.rb
@@ -66,6 +66,31 @@ def test_install
assert_equal [@a1], inst.installed_gems
end
+ def test_install_all_dependencies
+ e1, e1_gem = util_gem 'e', '1' do |s|
+ s.add_dependency 'b'
+ end
+
+ util_clear_gems
+
+ FileUtils.mv @a1_gem, @tempdir
+ FileUtils.mv @b1_gem, @tempdir
+ FileUtils.mv e1_gem, @tempdir
+ inst = nil
+
+ Dir.chdir @tempdir do
+ inst = Gem::DependencyInstaller.new :ignore_dependencies => true
+ inst.install 'b'
+ end
+
+ Dir.chdir @tempdir do
+ inst = Gem::DependencyInstaller.new
+ inst.install 'e'
+ end
+
+ assert_equal %w[e-1 a-1], inst.installed_gems.map { |s| s.full_name }
+ end
+
def test_install_cache_dir
FileUtils.mv @a1_gem, @tempdir
FileUtils.mv @b1_gem, @tempdir
Please sign in to comment.
Something went wrong with that request. Please try again.