From e3e9f4add3ab25776c43816b916543995db8fb4e Mon Sep 17 00:00:00 2001 From: Adam Prescott Date: Thu, 7 May 2015 16:51:45 -0400 Subject: Allow bundle viz to work with dependencies satisfied by prereleases. Suppose a Gemfile specifies a dependency, `foo`: foo Let's say `foo` requires a certain `bar`: foo bar (>= 0.5) If this dependency happens to be satisfied by a prerelease `bar`, e.g., 0.6.pre, then `bundle viz` will error. The cause of this error is that `Bundler::Graph#_populate_relations` executes child_dependencies = dependency.to_spec.runtime_dependencies.to_set and if `dependency` (here, `bar`), is a prerelease, then `dependency.to_spec` will be `nil` on Rubygems 2.4.0 and higher because of changes to `#to_spec`. By forcing `dependency.prerelease = true`, then `to_spec` won't ignore the prerelease `bar` dependency, which prevents `dependency.to_spec` to from being `nil`. This should address GitHub issues 3621 and 3217. --- spec/support/rubygems_ext.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'spec/support/rubygems_ext.rb') diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb index 6d71d32e..3426deff 100644 --- a/spec/support/rubygems_ext.rb +++ b/spec/support/rubygems_ext.rb @@ -12,7 +12,7 @@ module Spec unless File.exist?("#{Path.base_system_gems}") FileUtils.mkdir_p(Path.base_system_gems) - puts "fetching fakeweb, artifice, sinatra, rake, rack, and builder for the tests to use..." + puts "installing gems for the tests to use..." `gem install fakeweb artifice --no-rdoc --no-ri` `gem install sinatra --version 1.2.7 --no-rdoc --no-ri` # Rake version has to be consistent for tests to pass @@ -20,6 +20,8 @@ module Spec # 3.0.0 breaks 1.9.2 specs `gem install builder --version 2.1.2 --no-rdoc --no-ri` `gem install rack --no-rdoc --no-ri` + # ruby-graphviz is used by the viz tests + `gem install ruby-graphviz --no-rdoc --no-ri` end ENV['HOME'] = Path.home.to_s -- cgit v1.2.3