diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-01 23:29:38 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-01 23:29:38 +0000 |
commit | be7b5929126cb3e696ef222339237faba9b8fe5a (patch) | |
tree | 51eae376f93c09bc82dde5a657a91df2c89062e4 /spec/bundler/support/indexes.rb | |
parent | ae49dbd392083f69026f2a0fff4a1d5f42d172a7 (diff) | |
download | ruby-be7b5929126cb3e696ef222339237faba9b8fe5a.tar.gz |
Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0.
* common.mk: rspec examples of bundler-1.16.0 needs require option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/bundler/support/indexes.rb')
-rw-r--r-- | spec/bundler/support/indexes.rb | 70 |
1 files changed, 55 insertions, 15 deletions
diff --git a/spec/bundler/support/indexes.rb b/spec/bundler/support/indexes.rb index 29780014fc..05605195b1 100644 --- a/spec/bundler/support/indexes.rb +++ b/spec/bundler/support/indexes.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Spec module Indexes def dep(name, reqs = nil) @@ -16,12 +17,16 @@ module Spec def resolve(args = []) @platforms ||= ["ruby"] deps = [] + default_source = instance_double("Bundler::Source::Rubygems", :specs => @index) + source_requirements = { :default => default_source } @deps.each do |d| @platforms.each do |p| + source_requirements[d.name] = d.source = default_source deps << Bundler::DepProxy.new(d, p) end end - Bundler::Resolver.resolve(deps, @index, *args) + source_requirements ||= {} + Bundler::Resolver.resolve(deps, @index, source_requirements, *args) end def should_resolve_as(specs) @@ -62,13 +67,16 @@ module Spec s.level = opts.first s.strict = opts.include?(:strict) end - should_resolve_and_include specs, [{}, @base, search] + should_resolve_and_include specs, [@base, search] end def an_awesome_index build_index do - gem "rack", %w(0.8 0.9 0.9.1 0.9.2 1.0 1.1) - gem "rack-mount", %w(0.4 0.5 0.5.1 0.5.2 0.6) + gem "rack", %w[0.8 0.9 0.9.1 0.9.2 1.0 1.1] + gem "rack-mount", %w[0.4 0.5 0.5.1 0.5.2 0.6] + + # --- Pre-release support + gem "rubygems\0", ["1.3.2"] # --- Rails versions "1.2.3 2.2.3 2.3.5 3.0.0.beta 3.0.0.beta1" do |version| @@ -129,6 +137,14 @@ module Spec dep "activesupport", ">= #{version}" end end + + gem "reform", ["1.0.0"] do + dep "activesupport", ">= 1.0.0.beta1" + end + + gem "need-pre", ["1.0.0"] do + dep "activesupport", "~> 3.0.0.beta1" + end end end @@ -136,7 +152,7 @@ module Spec # goes well, it should resolve to 3.0.4 def a_conflict_index build_index do - gem "builder", %w(3.0.4 3.1.4) + gem "builder", %w[3.0.4 3.1.4] gem("grape", "0.2.6") do dep "builder", ">= 0" end @@ -156,11 +172,11 @@ module Spec def a_complex_conflict_index build_index do - gem("a", %w(1.0.2 1.1.4 1.2.0 1.4.0)) do + gem("a", %w[1.0.2 1.1.4 1.2.0 1.4.0]) do dep "d", ">= 0" end - gem("d", %w(1.3.0 1.4.1)) do + gem("d", %w[1.3.0 1.4.1]) do dep "x", ">= 0" end @@ -203,7 +219,7 @@ module Spec def index_with_conflict_on_child build_index do - gem "json", %w(1.6.5 1.7.7 1.8.0) + gem "json", %w[1.6.5 1.7.7 1.8.0] gem("chef", "10.26") do dep "json", [">= 1.4.4", "<= 1.7.7"] @@ -223,7 +239,7 @@ module Spec # Issue #3459 def a_complicated_index build_index do - gem "foo", %w(3.0.0 3.0.5) do + gem "foo", %w[3.0.0 3.0.5] do dep "qux", ["~> 3.1"] dep "baz", ["< 9.0", ">= 5.0"] dep "bar", ["~> 1.0"] @@ -262,7 +278,7 @@ module Spec dep "garply", [">= 0.3.1"] end - gem "grault", %w(2.6.3 3.1.1) + gem "grault", %w[2.6.3 3.1.1] gem "garply", "0.5.1" do dep "waldo", ["~> 0.1.3"] @@ -272,7 +288,7 @@ module Spec dep "plugh", ["~> 0.6.0"] end - gem "plugh", %w(0.6.3 0.6.11 0.7.0) + gem "plugh", %w[0.6.3 0.6.11 0.7.0] gem "qux", "3.2.21" do dep "plugh", [">= 0.6.4", "~> 0.6"] @@ -285,7 +301,7 @@ module Spec def a_unresovable_child_index build_index do - gem "json", %w(1.8.0) + gem "json", %w[1.8.0] gem("chef", "10.26") do dep "json", [">= 1.4.4", "<= 1.7.7"] @@ -304,10 +320,10 @@ module Spec def a_index_with_root_conflict_on_child build_index do - gem "builder", %w(2.1.2 3.0.1 3.1.3) - gem "i18n", %w(0.4.1 0.4.2) + gem "builder", %w[2.1.2 3.0.1 3.1.3] + gem "i18n", %w[0.4.1 0.4.2] - gem "activesupport", %w(3.0.0 3.0.1 3.0.5 3.1.7) + gem "activesupport", %w[3.0.0 3.0.1 3.0.5 3.1.7] gem("activemodel", "3.0.5") do dep "activesupport", "= 3.0.5" @@ -361,5 +377,29 @@ module Spec end end end + + def an_ambiguous_index + build_index do + gem("a", "1.0.0") do + dep "c", ">= 0" + end + + gem("b", %w[0.5.0 1.0.0]) + + gem("b", "2.0.0") do + dep "c", "< 2.0.0" + end + + gem("c", "1.0.0") do + dep "d", "1.0.0" + end + + gem("c", "2.0.0") do + dep "d", "2.0.0" + end + + gem("d", %w[1.0.0 2.0.0]) + end + end end end |