rubygems-update 3.2.5 → 3.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/Manifest.txt +2 -0
  4. data/Rakefile +15 -14
  5. data/bundler/CHANGELOG.md +73 -0
  6. data/bundler/lib/bundler.rb +1 -1
  7. data/bundler/lib/bundler/build_metadata.rb +2 -2
  8. data/bundler/lib/bundler/cli.rb +1 -0
  9. data/bundler/lib/bundler/cli/cache.rb +1 -0
  10. data/bundler/lib/bundler/cli/gem.rb +12 -0
  11. data/bundler/lib/bundler/definition.rb +66 -56
  12. data/bundler/lib/bundler/dep_proxy.rb +15 -8
  13. data/bundler/lib/bundler/dsl.rb +38 -25
  14. data/bundler/lib/bundler/feature_flag.rb +0 -2
  15. data/bundler/lib/bundler/fetcher.rb +0 -1
  16. data/bundler/lib/bundler/gem_helper.rb +8 -6
  17. data/bundler/lib/bundler/gem_version_promoter.rb +2 -2
  18. data/bundler/lib/bundler/index.rb +6 -5
  19. data/bundler/lib/bundler/inline.rb +1 -0
  20. data/bundler/lib/bundler/installer.rb +0 -17
  21. data/bundler/lib/bundler/installer/standalone.rb +15 -0
  22. data/bundler/lib/bundler/lazy_specification.rb +9 -18
  23. data/bundler/lib/bundler/lockfile_parser.rb +12 -8
  24. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-config.1 +6 -12
  30. data/bundler/lib/bundler/man/bundle-config.1.ronn +11 -18
  31. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle.1 +1 -1
  49. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  50. data/bundler/lib/bundler/plugin.rb +1 -0
  51. data/bundler/lib/bundler/plugin/installer.rb +8 -9
  52. data/bundler/lib/bundler/resolver.rb +110 -80
  53. data/bundler/lib/bundler/resolver/spec_group.rb +56 -44
  54. data/bundler/lib/bundler/rubygems_ext.rb +16 -0
  55. data/bundler/lib/bundler/settings.rb +1 -2
  56. data/bundler/lib/bundler/shared_helpers.rb +2 -2
  57. data/bundler/lib/bundler/source/git.rb +1 -1
  58. data/bundler/lib/bundler/source/rubygems.rb +10 -2
  59. data/bundler/lib/bundler/source_list.rb +34 -25
  60. data/bundler/lib/bundler/spec_set.rb +5 -4
  61. data/bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
  62. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
  63. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -1
  64. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
  65. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +2 -2
  66. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
  67. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +11 -7
  68. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +5 -6
  69. data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +1 -1
  70. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +4 -2
  71. data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +1 -1
  72. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
  73. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +9 -8
  74. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +5 -2
  75. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
  76. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  77. data/bundler/lib/bundler/version.rb +1 -1
  78. data/lib/rubygems.rb +3 -3
  79. data/lib/rubygems/command.rb +1 -0
  80. data/lib/rubygems/dependency.rb +5 -1
  81. data/lib/rubygems/ext/builder.rb +2 -1
  82. data/lib/rubygems/installer_uninstaller_utils.rb +6 -1
  83. data/lib/rubygems/platform.rb +0 -4
  84. data/lib/rubygems/requirement.rb +1 -1
  85. data/lib/rubygems/resolver/index_specification.rb +4 -1
  86. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
  87. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +0 -1
  88. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
  89. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +2 -2
  90. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
  91. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +11 -7
  92. data/lib/rubygems/specification.rb +13 -11
  93. data/lib/rubygems/test_case.rb +5 -6
  94. data/rubygems-update.gemspec +1 -1
  95. data/test/rubygems/data/null-required-ruby-version.gemspec.rz +0 -0
  96. data/test/rubygems/test_gem.rb +85 -8
  97. data/test/rubygems/test_gem_commands_outdated_command.rb +18 -0
  98. data/test/rubygems/test_gem_dependency_installer.rb +27 -18
  99. data/test/rubygems/test_gem_ext_builder.rb +24 -0
  100. data/test/rubygems/test_gem_installer.rb +2 -0
  101. data/test/rubygems/test_gem_platform.rb +8 -0
  102. data/test/rubygems/test_gem_requirement.rb +35 -1
  103. data/test/rubygems/test_gem_specification.rb +10 -15
  104. data/test/rubygems/test_gem_stream_ui.rb +1 -1
  105. data/test/rubygems/test_gem_util.rb +4 -4
  106. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f6bb6c4c3306717f1cbb6c31a681fb34fe87a80908be9788cf9b8670acd0f45
4
- data.tar.gz: 54f8871259d5e897c28946c66908e8ee64cf96be9dfd13e3fe47ed75f92a0fca
3
+ metadata.gz: e482e0b6b43dc7594405f537f149db6f78314c06e2a15c609f4023951ca0d7d7
4
+ data.tar.gz: ac6f951b732cdb60f3164e65d2c46f31c8e04c4bf70d50efc0059ad7f4ae2e6d
5
5
  SHA512:
6
- metadata.gz: 56a73fe1ec095a370b2b8ebc93e0a4aa8e8986841b33b02a5eca4475e89fa59929039a4a9aae248e4aa8f6cef2236d7e47d887c98df2487ab5f5f265af1f2084
7
- data.tar.gz: 50aacfbe514a2c5a0567325bded2095de0fdb2a33f794bb8f2872855848ad88594d82189bfcf67767909daf9e8e6f984f3a7b9de5dcd1bf1c4c34f018ea51ec2
6
+ metadata.gz: db6d0b7178aa13690c92fe513b08c1fb05772866384cf258b2350daa49fe1a635163511306ac2dc3b392a77a751404925478e4cabb61901c1ca46052a993b0cc
7
+ data.tar.gz: b545dc793092b3d0b79318763ca84e8cb0e8a91288de8351592cc11b9164930a22320701f0a8ad36051e0b986b65df6b5a400fcf6838e03f31f4e215cf431514
data/CHANGELOG.md CHANGED
@@ -1,3 +1,53 @@
1
+ # 3.2.10 / 2021-02-15
2
+
3
+ ## Documentation:
4
+
5
+ * Add a `gem push` example to `gem help`. Pull request #4373 by
6
+ deivid-rodriguez
7
+ * Improve documentation for `required_ruby_version`. Pull request #4343 by
8
+ AlexWayfer
9
+
10
+ # 3.2.9 / 2021-02-08
11
+
12
+ ## Bug fixes:
13
+
14
+ * Fix error message when underscore selection can't find bundler. Pull
15
+ request #4363 by deivid-rodriguez
16
+ * Fix `Gem::Specification.stubs_for` returning wrong named specs. Pull
17
+ request #4356 by tompng
18
+ * Don't error out when activating a binstub unless necessary. Pull request
19
+ #4351 by deivid-rodriguez
20
+ * Fix `gem outdated` incorrectly handling platform specific gems. Pull
21
+ request #4248 by deivid-rodriguez
22
+
23
+ # 3.2.8 / 2021-02-02
24
+
25
+ ## Bug fixes:
26
+
27
+ * Fix `gem install` crashing on gemspec with nil required_ruby_version.
28
+ Pull request #4334 by pbernays
29
+
30
+ # 3.2.7 / 2021-01-26
31
+
32
+ ## Bug fixes:
33
+
34
+ * Generate plugin wrappers with relative requires. Pull request #4317 by
35
+ deivid-rodriguez
36
+
37
+ # 3.2.6 / 2021-01-18
38
+
39
+ ## Enhancements:
40
+
41
+ * Fix `Gem::Platform#inspect` showing duplicate information. Pull request
42
+ #4276 by deivid-rodriguez
43
+
44
+ ## Bug fixes:
45
+
46
+ * Swallow any system call error in `ensure_gem_subdirs` to support jruby
47
+ embedded paths. Pull request #4291 by kares
48
+ * Restore accepting custom make command with extra options as the `make`
49
+ env variable. Pull request #4271 by terceiro
50
+
1
51
  # 3.2.5 / 2021-01-11
2
52
 
3
53
  ## Bug fixes:
data/Manifest.txt CHANGED
@@ -189,6 +189,7 @@ bundler/lib/bundler/templates/Executable.bundler
189
189
  bundler/lib/bundler/templates/Executable.standalone
190
190
  bundler/lib/bundler/templates/Gemfile
191
191
  bundler/lib/bundler/templates/gems.rb
192
+ bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt
192
193
  bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt
193
194
  bundler/lib/bundler/templates/newgem/Gemfile.tt
194
195
  bundler/lib/bundler/templates/newgem/LICENSE.txt.tt
@@ -511,6 +512,7 @@ test/rubygems/child_key.pem
511
512
  test/rubygems/client.pem
512
513
  test/rubygems/data/gem-private_key.pem
513
514
  test/rubygems/data/gem-public_cert.pem
515
+ test/rubygems/data/null-required-ruby-version.gemspec.rz
514
516
  test/rubygems/data/null-required-rubygems-version.gemspec.rz
515
517
  test/rubygems/data/null-type.gemspec.rz
516
518
  test/rubygems/encrypted_private_key.pem
data/Rakefile CHANGED
@@ -7,7 +7,12 @@ require 'psych'
7
7
 
8
8
  desc "Setup Rubygems dev environment"
9
9
  task :setup do
10
- sh "ruby bundler/bin/bundle install --gemfile=dev_gems.rb"
10
+ sh "ruby", "bundler/bin/bundle", "install", "--gemfile=dev_gems.rb"
11
+ end
12
+
13
+ desc "Update Rubygems dev environment"
14
+ task :update do |_, args|
15
+ sh "ruby", "bundler/bin/bundle", "update", *args, "--gemfile=dev_gems.rb"
11
16
  end
12
17
 
13
18
  desc "Setup git hooks"
@@ -47,20 +52,16 @@ RDoc::Task.new :rdoc => 'docs', :clobber_rdoc => 'clobber_docs' do |doc|
47
52
  doc.rdoc_dir = 'doc'
48
53
  end
49
54
 
50
- begin
51
- require "automatiek"
55
+ load "util/automatiek.rake"
52
56
 
53
- Automatiek::RakeTask.new("molinillo") do |lib|
54
- lib.version = "0.7.0"
55
- lib.download = { :github => "https://github.com/CocoaPods/Molinillo" }
56
- lib.namespace = "Molinillo"
57
- lib.prefix = "Gem::Resolver"
58
- lib.vendor_lib = "lib/rubygems/resolver/molinillo"
59
- end
60
- rescue LoadError
61
- namespace :vendor do
62
- task(:molinillo) { abort "Install the automatiek gem to be able to vendor gems." }
63
- end
57
+ # We currently ship Molinillo master branch as of
58
+ # https://github.com/CocoaPods/Molinillo/commit/7cc27a355e861bdf593e2cde7bf1bca3daae4303
59
+ Automatiek::RakeTask.new("molinillo") do |lib|
60
+ lib.version = "master"
61
+ lib.download = { :github => "https://github.com/CocoaPods/Molinillo" }
62
+ lib.namespace = "Molinillo"
63
+ lib.prefix = "Gem::Resolver"
64
+ lib.vendor_lib = "lib/rubygems/resolver/molinillo"
64
65
  end
65
66
 
66
67
  namespace :rubocop do
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,76 @@
1
+ # 2.2.10 (February 15, 2021)
2
+
3
+ ## Security fixes:
4
+
5
+ - Fix source priority for transitive dependencies and split lockfile rubygems source sections [#3655](https://github.com/rubygems/rubygems/pull/3655)
6
+
7
+ ## Bug fixes:
8
+
9
+ - Fix adding platforms to lockfile sometimes conflicting on ruby requirements [#4371](https://github.com/rubygems/rubygems/pull/4371)
10
+ - Fix bundler sometimes choosing ruby variants over java ones [#4367](https://github.com/rubygems/rubygems/pull/4367)
11
+
12
+ ## Documentation:
13
+
14
+ - Update man pages to reflect to new default for bundle install jobs [#4188](https://github.com/rubygems/rubygems/pull/4188)
15
+
16
+ # 2.2.9 (February 8, 2021)
17
+
18
+ ## Enhancements:
19
+
20
+ - Stop removing existing platforms when force_ruby_platform is true [#4336](https://github.com/rubygems/rubygems/pull/4336)
21
+
22
+ ## Bug fixes:
23
+
24
+ - Don't install platform specific gems on truffleruby [#4333](https://github.com/rubygems/rubygems/pull/4333)
25
+
26
+ # 2.2.8 (February 2, 2021)
27
+
28
+ ## Enhancements:
29
+
30
+ - Add a CHANGELOG.md file to gems generated by `bundle gem` [#4093](https://github.com/rubygems/rubygems/pull/4093)
31
+ - Support gemified `set` [#4297](https://github.com/rubygems/rubygems/pull/4297)
32
+
33
+ ## Bug fixes:
34
+
35
+ - Fix standalone Kernel.require visibility [#4337](https://github.com/rubygems/rubygems/pull/4337)
36
+
37
+ ## Performance:
38
+
39
+ - Fix resolver edge cases and speed up bundler [#4277](https://github.com/rubygems/rubygems/pull/4277)
40
+
41
+ # 2.2.7 (January 26, 2021)
42
+
43
+ ## Enhancements:
44
+
45
+ - Improve error messages when dependency on bundler conflicts with running version [#4308](https://github.com/rubygems/rubygems/pull/4308)
46
+ - Avoid showing platforms with requirements in error messages [#4310](https://github.com/rubygems/rubygems/pull/4310)
47
+ - Introduce disable_local_revision_check config [#4237](https://github.com/rubygems/rubygems/pull/4237)
48
+ - Reverse rubygems require mixin with bundler standalone [#4299](https://github.com/rubygems/rubygems/pull/4299)
49
+
50
+ ## Bug fixes:
51
+
52
+ - Fix releasing from a not yet pushed branch [#4309](https://github.com/rubygems/rubygems/pull/4309)
53
+ - Install cache only once if it already exists [#4304](https://github.com/rubygems/rubygems/pull/4304)
54
+ - Fix `force_ruby_platform` no longer being respected [#4302](https://github.com/rubygems/rubygems/pull/4302)
55
+
56
+ ## Performance:
57
+
58
+ - Fix resolver dependency comparison [#4289](https://github.com/rubygems/rubygems/pull/4289)
59
+
60
+ # 2.2.6 (January 18, 2021)
61
+
62
+ ## Enhancements:
63
+
64
+ - Improve resolver debugging [#4288](https://github.com/rubygems/rubygems/pull/4288)
65
+
66
+ ## Bug fixes:
67
+
68
+ - Fix dependency locking for path source [#4293](https://github.com/rubygems/rubygems/pull/4293)
69
+
70
+ ## Performance:
71
+
72
+ - Speed up complex dependency resolves by creating DepProxy factory and cache [#4216](https://github.com/rubygems/rubygems/pull/4216)
73
+
1
74
  # 2.2.5 (January 11, 2021)
2
75
 
3
76
  ## Enhancements:
@@ -440,7 +440,7 @@ EOF
440
440
  end
441
441
 
442
442
  def local_platform
443
- return Gem::Platform::RUBY if settings[:force_ruby_platform]
443
+ return Gem::Platform::RUBY if settings[:force_ruby_platform] || Gem.platforms == [Gem::Platform::RUBY]
444
444
  Gem::Platform.local
445
445
  end
446
446
 
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2021-01-11".freeze
8
- @git_commit_sha = "ba867aed7f".freeze
7
+ @built_at = "2021-02-15".freeze
8
+ @git_commit_sha = "cc7c333721".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -586,6 +586,7 @@ module Bundler
586
586
  method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
587
587
  method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
588
588
  method_option :rubocop, :type => :boolean, :desc => "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
589
+ method_option :changelog, :type => :boolean, :desc => "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
589
590
  method_option :test, :type => :string, :lazy_default => Bundler.settings["gem.test"] || "", :aliases => "-t", :banner => "Use the specified test framework for your library",
590
591
  :desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
591
592
  method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",
@@ -30,6 +30,7 @@ module Bundler
30
30
  require_relative "install"
31
31
  options = self.options.dup
32
32
  options["local"] = false if Bundler.settings[:cache_all_platforms]
33
+ options["no-cache"] = true
33
34
  Bundler::CLI::Install.new(options).run
34
35
  end
35
36
 
@@ -142,6 +142,18 @@ module Bundler
142
142
  templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
143
143
  end
144
144
 
145
+ if ask_and_set(:changelog, "Do you want to include a changelog?",
146
+ "A changelog is a file which contains a curated, chronologically ordered list of notable " \
147
+ "changes for each version of a project. To make it easier for users and contributors to" \
148
+ " see precisely what notable changes have been made between each release (or version) of" \
149
+ " the project. Whether consumers or developers, the end users of software are" \
150
+ " human beings who care about what's in the software. When the software changes, people " \
151
+ "want to know why and how. see https://keepachangelog.com")
152
+ config[:changelog] = true
153
+ Bundler.ui.info "Changelog enabled in config"
154
+ templates.merge!("CHANGELOG.md.tt" => "CHANGELOG.md")
155
+ end
156
+
145
157
  if ask_and_set(:rubocop, "Do you want to add rubocop as a dependency for gems you generate?",
146
158
  "RuboCop is a static code analyzer that has out-of-the-box rules for many " \
147
159
  "of the guidelines in the community style guide. " \
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "lockfile_parser"
4
- require "set"
5
4
 
6
5
  module Bundler
7
6
  class Definition
@@ -83,11 +82,7 @@ module Bundler
83
82
  @lockfile_contents = Bundler.read_file(lockfile)
84
83
  @locked_gems = LockfileParser.new(@lockfile_contents)
85
84
  @locked_platforms = @locked_gems.platforms
86
- if Bundler.settings[:force_ruby_platform]
87
- @platforms = [Gem::Platform::RUBY]
88
- else
89
- @platforms = @locked_platforms.dup
90
- end
85
+ @platforms = @locked_platforms.dup
91
86
  @locked_bundler_version = @locked_gems.bundler_version
92
87
  @locked_ruby_version = @locked_gems.ruby_version
93
88
 
@@ -111,6 +106,19 @@ module Bundler
111
106
  @locked_platforms = []
112
107
  end
113
108
 
109
+ @locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
110
+ @disable_multisource = !Bundler.frozen_bundle? || @locked_gem_sources.none? {|s| s.remotes.size > 1 }
111
+
112
+ unless @disable_multisource
113
+ msg = "Your lockfile contains a single rubygems source section with multiple remotes, which is insecure. " \
114
+ "You should regenerate your lockfile in a non frozen environment."
115
+
116
+ Bundler::SharedHelpers.major_deprecation 2, msg
117
+
118
+ @sources.allow_multisource!
119
+ @locked_gem_sources.each(&:allow_multisource!)
120
+ end
121
+
114
122
  @unlock[:gems] ||= []
115
123
  @unlock[:sources] ||= []
116
124
  @unlock[:ruby] ||= if @ruby_version && locked_ruby_version_object
@@ -150,6 +158,14 @@ module Bundler
150
158
  end
151
159
  end
152
160
 
161
+ def disable_multisource?
162
+ @disable_multisource
163
+ end
164
+
165
+ def allow_multisource!
166
+ @disable_multisource = false
167
+ end
168
+
153
169
  def resolve_with_cache!
154
170
  raise "Specs already loaded" if @specs
155
171
  sources.cached!
@@ -259,23 +275,18 @@ module Bundler
259
275
  def resolve
260
276
  @resolve ||= begin
261
277
  last_resolve = converge_locked_specs
262
- resolve =
263
- if Bundler.frozen_bundle?
264
- Bundler.ui.debug "Frozen, using resolution from the lockfile"
265
- last_resolve
266
- elsif !unlocking? && nothing_changed?
267
- Bundler.ui.debug("Found no changes, using resolution from the lockfile")
268
- last_resolve
269
- else
270
- # Run a resolve against the locally available gems
271
- Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
272
- expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, @remote)
273
- last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
274
- end
275
-
276
- # filter out gems that _can_ be installed on multiple platforms, but don't need
277
- # to be
278
- resolve.for(expand_dependencies(dependencies, true), [], false, false, false)
278
+ if Bundler.frozen_bundle?
279
+ Bundler.ui.debug "Frozen, using resolution from the lockfile"
280
+ last_resolve
281
+ elsif !unlocking? && nothing_changed?
282
+ Bundler.ui.debug("Found no changes, using resolution from the lockfile")
283
+ last_resolve
284
+ else
285
+ # Run a resolve against the locally available gems
286
+ Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
287
+ expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, @remote)
288
+ Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
289
+ end
279
290
  end
280
291
  end
281
292
 
@@ -540,6 +551,9 @@ module Bundler
540
551
  attr_reader :sources
541
552
  private :sources
542
553
 
554
+ attr_reader :locked_gem_sources
555
+ private :locked_gem_sources
556
+
543
557
  def nothing_changed?
544
558
  !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@locked_specs_incomplete_for_platform
545
559
  end
@@ -604,7 +618,7 @@ module Bundler
604
618
  deps_for_source = @dependencies.select {|s| s.source == source }
605
619
  locked_deps_for_source = @locked_deps.values.select {|dep| dep.source == locked_source }
606
620
 
607
- Set.new(deps_for_source) != Set.new(locked_deps_for_source)
621
+ deps_for_source.sort != locked_deps_for_source.sort
608
622
  end
609
623
 
610
624
  def specs_for_source_changed?(source)
@@ -664,21 +678,20 @@ module Bundler
664
678
  end
665
679
 
666
680
  def converge_rubygems_sources
667
- return false if Bundler.feature_flag.disable_multisource?
681
+ return false if disable_multisource?
668
682
 
669
- changes = false
683
+ return false if locked_gem_sources.empty?
670
684
 
671
- # Get the RubyGems sources from the Gemfile.lock
672
- locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
673
685
  # Get the RubyGems remotes from the Gemfile
674
686
  actual_remotes = sources.rubygems_remotes
687
+ return false if actual_remotes.empty?
688
+
689
+ changes = false
675
690
 
676
691
  # If there is a RubyGems source in both
677
- if !locked_gem_sources.empty? && !actual_remotes.empty?
678
- locked_gem_sources.each do |locked_gem|
679
- # Merge the remotes from the Gemfile into the Gemfile.lock
680
- changes |= locked_gem.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
681
- end
692
+ locked_gem_sources.each do |locked_gem|
693
+ # Merge the remotes from the Gemfile into the Gemfile.lock
694
+ changes |= locked_gem.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
682
695
  end
683
696
 
684
697
  changes
@@ -818,11 +831,6 @@ module Bundler
818
831
  # commonly happens if the version changed in the gemspec
819
832
  next unless new_spec
820
833
 
821
- new_runtime_deps = new_spec.dependencies.select {|d| d.type != :development }
822
- old_runtime_deps = s.dependencies.select {|d| d.type != :development }
823
- # If the dependencies of the path source have changed and locked spec can't satisfy new dependencies, unlock it
824
- next unless new_runtime_deps.sort == old_runtime_deps.sort || new_runtime_deps.all? {|d| satisfies_locked_spec?(d) }
825
-
826
834
  s.dependencies.replace(new_spec.dependencies)
827
835
  end
828
836
 
@@ -889,7 +897,7 @@ module Bundler
889
897
  dependencies.each do |dep|
890
898
  dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
891
899
  next unless remote || dep.current_platform?
892
- target_platforms = dep.gem_platforms(remote ? Resolver.sort_platforms(@platforms) : [generic_local_platform])
900
+ target_platforms = dep.gem_platforms(remote ? @platforms : [generic_local_platform])
893
901
  deps += expand_dependency_with_platforms(dep, target_platforms)
894
902
  end
895
903
  deps
@@ -897,7 +905,7 @@ module Bundler
897
905
 
898
906
  def expand_dependency_with_platforms(dep, platforms)
899
907
  platforms.map do |p|
900
- DepProxy.new(dep, p)
908
+ DepProxy.get_proxy(dep, p)
901
909
  end
902
910
  end
903
911
 
@@ -908,29 +916,18 @@ module Bundler
908
916
  # Record the specs available in each gem's source, so that those
909
917
  # specs will be available later when the resolver knows where to
910
918
  # look for that gemspec (or its dependencies)
911
- default = sources.default_source
912
- source_requirements = { :default => default }
913
- default = nil unless Bundler.feature_flag.disable_multisource?
914
- dependencies.each do |dep|
915
- next unless source = dep.source || default
916
- source_requirements[dep.name] = source
917
- end
919
+ source_requirements = { :default => sources.default_source }.merge(dependency_source_requirements)
918
920
  metadata_dependencies.each do |dep|
919
921
  source_requirements[dep.name] = sources.metadata_source
920
922
  end
923
+ source_requirements[:global] = index unless disable_multisource?
924
+ source_requirements[:default_bundler] = source_requirements["bundler"] || source_requirements[:default]
921
925
  source_requirements["bundler"] = sources.metadata_source # needs to come last to override
922
926
  source_requirements
923
927
  end
924
928
 
925
929
  def pinned_spec_names(skip = nil)
926
- pinned_names = []
927
- default = Bundler.feature_flag.disable_multisource? && sources.default_source
928
- @dependencies.each do |dep|
929
- next unless dep_source = dep.source || default
930
- next if dep_source == skip
931
- pinned_names << dep.name
932
- end
933
- pinned_names
930
+ dependency_source_requirements.reject {|_, source| source == skip }.keys
934
931
  end
935
932
 
936
933
  def requested_groups
@@ -977,7 +974,7 @@ module Bundler
977
974
  next requirements if @locked_gems.dependencies[name] != dependency
978
975
  next requirements if dependency.source.is_a?(Source::Path)
979
976
  dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
980
- requirements[name] = DepProxy.new(dep, locked_spec.platform)
977
+ requirements[name] = DepProxy.get_proxy(dep, locked_spec.platform)
981
978
  requirements
982
979
  end.values
983
980
  end
@@ -987,5 +984,18 @@ module Bundler
987
984
 
988
985
  Bundler.settings[:allow_deployment_source_credential_changes] && source.equivalent_remotes?(sources.rubygems_remotes)
989
986
  end
987
+
988
+ def dependency_source_requirements
989
+ @dependency_source_requirements ||= begin
990
+ source_requirements = {}
991
+ default = disable_multisource? && sources.default_source
992
+ dependencies.each do |dep|
993
+ dep_source = dep.source || default
994
+ next unless dep_source
995
+ source_requirements[dep.name] = dep_source
996
+ end
997
+ source_requirements
998
+ end
999
+ end
990
1000
  end
991
1001
  end