rubygems-update 3.5.22 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +91 -0
  3. data/Manifest.txt +23 -16
  4. data/README.md +14 -9
  5. data/bundler/CHANGELOG.md +83 -0
  6. data/bundler/bundler.gemspec +2 -2
  7. data/bundler/lib/bundler/build_metadata.rb +2 -2
  8. data/bundler/lib/bundler/cli/add.rb +2 -0
  9. data/bundler/lib/bundler/cli/check.rb +2 -2
  10. data/bundler/lib/bundler/cli/console.rb +0 -4
  11. data/bundler/lib/bundler/cli/doctor.rb +4 -4
  12. data/bundler/lib/bundler/cli/exec.rb +1 -0
  13. data/bundler/lib/bundler/cli/gem.rb +1 -1
  14. data/bundler/lib/bundler/cli/info.rb +2 -2
  15. data/bundler/lib/bundler/cli/inject.rb +1 -1
  16. data/bundler/lib/bundler/cli/install.rb +4 -0
  17. data/bundler/lib/bundler/cli/lock.rb +20 -1
  18. data/bundler/lib/bundler/cli/pristine.rb +1 -1
  19. data/bundler/lib/bundler/cli/show.rb +2 -2
  20. data/bundler/lib/bundler/cli.rb +23 -53
  21. data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -5
  22. data/bundler/lib/bundler/compact_index_client/updater.rb +0 -11
  23. data/bundler/lib/bundler/definition.rb +143 -76
  24. data/bundler/lib/bundler/dependency.rb +1 -1
  25. data/bundler/lib/bundler/dsl.rb +33 -28
  26. data/bundler/lib/bundler/endpoint_specification.rb +10 -1
  27. data/bundler/lib/bundler/errors.rb +10 -0
  28. data/bundler/lib/bundler/feature_flag.rb +1 -0
  29. data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
  30. data/bundler/lib/bundler/fetcher.rb +10 -3
  31. data/bundler/lib/bundler/gem_helpers.rb +21 -5
  32. data/bundler/lib/bundler/injector.rb +2 -2
  33. data/bundler/lib/bundler/inline.rb +12 -8
  34. data/bundler/lib/bundler/installer/standalone.rb +2 -2
  35. data/bundler/lib/bundler/installer.rb +4 -38
  36. data/bundler/lib/bundler/lazy_specification.rb +74 -26
  37. data/bundler/lib/bundler/lockfile_generator.rb +1 -1
  38. data/bundler/lib/bundler/lockfile_parser.rb +9 -1
  39. data/bundler/lib/bundler/man/bundle-add.1 +17 -11
  40. data/bundler/lib/bundler/man/bundle-add.1.ronn +16 -10
  41. data/bundler/lib/bundler/man/bundle-binstubs.1 +7 -4
  42. data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
  43. data/bundler/lib/bundler/man/bundle-cache.1 +30 -2
  44. data/bundler/lib/bundler/man/bundle-cache.1.ronn +31 -2
  45. data/bundler/lib/bundler/man/bundle-check.1 +3 -3
  46. data/bundler/lib/bundler/man/bundle-check.1.ronn +4 -2
  47. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle-config.1 +3 -5
  49. data/bundler/lib/bundler/man/bundle-config.1.ronn +2 -7
  50. data/bundler/lib/bundler/man/bundle-console.1 +2 -4
  51. data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -7
  52. data/bundler/lib/bundler/man/bundle-doctor.1 +2 -2
  53. data/bundler/lib/bundler/man/bundle-doctor.1.ronn +1 -1
  54. data/bundler/lib/bundler/man/bundle-env.1 +9 -0
  55. data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
  56. data/bundler/lib/bundler/man/bundle-exec.1 +5 -2
  57. data/bundler/lib/bundler/man/bundle-exec.1.ronn +4 -1
  58. data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
  59. data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
  60. data/bundler/lib/bundler/man/bundle-gem.1 +17 -5
  61. data/bundler/lib/bundler/man/bundle-gem.1.ronn +27 -6
  62. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  63. data/bundler/lib/bundler/man/bundle-info.1 +5 -2
  64. data/bundler/lib/bundler/man/bundle-info.1.ronn +6 -2
  65. data/bundler/lib/bundler/man/bundle-init.1 +3 -3
  66. data/bundler/lib/bundler/man/bundle-init.1.ronn +3 -2
  67. data/bundler/lib/bundler/man/bundle-inject.1 +10 -2
  68. data/bundler/lib/bundler/man/bundle-inject.1.ronn +9 -1
  69. data/bundler/lib/bundler/man/bundle-install.1 +15 -12
  70. data/bundler/lib/bundler/man/bundle-install.1.ronn +22 -18
  71. data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
  72. data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
  73. data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
  74. data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  75. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  76. data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
  77. data/bundler/lib/bundler/man/bundle-lock.1 +21 -6
  78. data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
  79. data/bundler/lib/bundler/man/bundle-open.1 +2 -2
  80. data/bundler/lib/bundler/man/bundle-open.1.ronn +2 -1
  81. data/bundler/lib/bundler/man/bundle-outdated.1 +8 -5
  82. data/bundler/lib/bundler/man/bundle-outdated.1.ronn +8 -4
  83. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  84. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  85. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  86. data/bundler/lib/bundler/man/bundle-pristine.1.ronn +1 -1
  87. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  88. data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
  89. data/bundler/lib/bundler/man/bundle-show.1 +5 -2
  90. data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
  91. data/bundler/lib/bundler/man/bundle-update.1 +13 -7
  92. data/bundler/lib/bundler/man/bundle-update.1.ronn +14 -6
  93. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  94. data/bundler/lib/bundler/man/bundle-viz.1 +4 -4
  95. data/bundler/lib/bundler/man/bundle-viz.1.ronn +7 -3
  96. data/bundler/lib/bundler/man/bundle.1 +1 -1
  97. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  98. data/bundler/lib/bundler/man/index.txt +4 -0
  99. data/bundler/lib/bundler/materialization.rb +59 -0
  100. data/bundler/lib/bundler/plugin/events.rb +24 -0
  101. data/bundler/lib/bundler/plugin/installer.rb +1 -1
  102. data/bundler/lib/bundler/plugin.rb +20 -1
  103. data/bundler/lib/bundler/process_lock.rb +10 -14
  104. data/bundler/lib/bundler/remote_specification.rb +6 -1
  105. data/bundler/lib/bundler/resolver/base.rb +6 -6
  106. data/bundler/lib/bundler/resolver/candidate.rb +2 -2
  107. data/bundler/lib/bundler/resolver/spec_group.rb +4 -3
  108. data/bundler/lib/bundler/resolver.rb +5 -5
  109. data/bundler/lib/bundler/rubygems_ext.rb +30 -27
  110. data/bundler/lib/bundler/rubygems_gem_installer.rb +3 -2
  111. data/bundler/lib/bundler/rubygems_integration.rb +23 -40
  112. data/bundler/lib/bundler/runtime.rb +27 -7
  113. data/bundler/lib/bundler/self_manager.rb +2 -3
  114. data/bundler/lib/bundler/settings.rb +6 -1
  115. data/bundler/lib/bundler/shared_helpers.rb +29 -17
  116. data/bundler/lib/bundler/source/git/git_proxy.rb +0 -6
  117. data/bundler/lib/bundler/source/git.rb +56 -31
  118. data/bundler/lib/bundler/source/metadata.rb +2 -3
  119. data/bundler/lib/bundler/source/path.rb +2 -2
  120. data/bundler/lib/bundler/source_list.rb +1 -1
  121. data/bundler/lib/bundler/spec_set.rb +81 -56
  122. data/bundler/lib/bundler/stub_specification.rb +8 -0
  123. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +0 -3
  124. data/bundler/lib/bundler/templates/newgem/README.md.tt +1 -1
  125. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +15 -15
  126. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -4
  127. data/bundler/lib/bundler/uri_credentials_filter.rb +1 -1
  128. data/bundler/lib/bundler/vendor/fileutils/COPYING +56 -0
  129. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
  130. data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
  131. data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +5 -5
  132. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
  133. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
  134. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
  135. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
  136. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
  137. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
  138. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
  139. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
  140. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  141. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  142. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +11 -0
  143. data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
  144. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +37 -16
  145. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
  146. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
  147. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
  148. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
  149. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
  150. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
  151. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  152. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +9 -9
  153. data/bundler/lib/bundler/vendored_securerandom.rb +0 -2
  154. data/bundler/lib/bundler/version.rb +1 -1
  155. data/bundler/lib/bundler.rb +38 -14
  156. data/{CONTRIBUTING.md → doc/rubygems/CONTRIBUTING.md} +9 -9
  157. data/{POLICIES.md → doc/rubygems/POLICIES.md} +11 -11
  158. data/lib/rubygems/basic_specification.rb +5 -4
  159. data/lib/rubygems/commands/cleanup_command.rb +2 -2
  160. data/lib/rubygems/commands/contents_command.rb +4 -4
  161. data/lib/rubygems/commands/exec_command.rb +3 -0
  162. data/lib/rubygems/commands/pristine_command.rb +2 -2
  163. data/lib/rubygems/commands/push_command.rb +29 -5
  164. data/lib/rubygems/commands/rdoc_command.rb +2 -2
  165. data/lib/rubygems/commands/rebuild_command.rb +0 -2
  166. data/lib/rubygems/commands/setup_command.rb +7 -16
  167. data/lib/rubygems/commands/unpack_command.rb +0 -6
  168. data/lib/rubygems/commands/update_command.rb +2 -8
  169. data/lib/rubygems/config_file.rb +12 -0
  170. data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
  171. data/lib/rubygems/defaults.rb +1 -1
  172. data/lib/rubygems/exceptions.rb +0 -6
  173. data/lib/rubygems/ext/builder.rb +6 -4
  174. data/lib/rubygems/ext/cargo_builder.rb +7 -4
  175. data/lib/rubygems/ext/cmake_builder.rb +7 -2
  176. data/lib/rubygems/ext/configure_builder.rb +7 -2
  177. data/lib/rubygems/ext/ext_conf_builder.rb +9 -5
  178. data/lib/rubygems/ext/rake_builder.rb +6 -1
  179. data/lib/rubygems/gem_runner.rb +9 -0
  180. data/lib/rubygems/gemcutter_utilities.rb +8 -2
  181. data/lib/rubygems/install_update_options.rb +5 -0
  182. data/lib/rubygems/installer.rb +8 -9
  183. data/lib/rubygems/package/tar_header.rb +11 -0
  184. data/lib/rubygems/package/tar_reader/entry.rb +1 -5
  185. data/lib/rubygems/platform.rb +4 -3
  186. data/lib/rubygems/psych_tree.rb +4 -0
  187. data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
  188. data/lib/rubygems/requirement.rb +0 -4
  189. data/lib/rubygems/resolver/composed_set.rb +3 -3
  190. data/lib/rubygems/resolver/git_set.rb +0 -1
  191. data/lib/rubygems/resolver/index_set.rb +2 -2
  192. data/lib/rubygems/resolver.rb +3 -3
  193. data/lib/rubygems/source/git.rb +13 -10
  194. data/lib/rubygems/spec_fetcher.rb +46 -7
  195. data/lib/rubygems/specification.rb +38 -32
  196. data/lib/rubygems/target_rbconfig.rb +50 -0
  197. data/lib/rubygems/uri.rb +1 -1
  198. data/lib/rubygems/util/licenses.rb +10 -1
  199. data/lib/rubygems/vendor/net-http/COPYING +56 -0
  200. data/lib/rubygems/vendor/net-http/lib/net/http/header.rb +1 -1
  201. data/lib/rubygems/vendor/net-http/lib/net/http/requests.rb +5 -0
  202. data/lib/rubygems/vendor/net-http/lib/net/http.rb +120 -36
  203. data/lib/rubygems/vendor/optparse/lib/optparse/ac.rb +16 -0
  204. data/lib/rubygems/vendor/optparse/lib/optparse/kwargs.rb +8 -3
  205. data/lib/rubygems/vendor/optparse/lib/optparse/version.rb +9 -0
  206. data/lib/rubygems/vendor/optparse/lib/optparse.rb +147 -51
  207. data/lib/rubygems/vendor/resolv/COPYING +56 -0
  208. data/lib/rubygems/vendor/resolv/lib/resolv.rb +50 -37
  209. data/lib/rubygems/vendor/securerandom/COPYING +56 -0
  210. data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +5 -5
  211. data/lib/rubygems/vendor/timeout/COPYING +56 -0
  212. data/lib/rubygems/vendor/timeout/lib/timeout.rb +5 -8
  213. data/lib/rubygems/vendor/uri/COPYING +56 -0
  214. data/lib/rubygems/vendor/uri/lib/uri/common.rb +37 -16
  215. data/lib/rubygems/vendor/uri/lib/uri/file.rb +3 -3
  216. data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +1 -1
  217. data/lib/rubygems/vendor/uri/lib/uri/generic.rb +16 -26
  218. data/lib/rubygems/vendor/uri/lib/uri/http.rb +2 -2
  219. data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
  220. data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
  221. data/lib/rubygems/vendor/uri/lib/uri/version.rb +1 -1
  222. data/lib/rubygems/vendor/uri/lib/uri.rb +9 -9
  223. data/lib/rubygems/vendored_securerandom.rb +0 -1
  224. data/lib/rubygems/version.rb +0 -4
  225. data/lib/rubygems.rb +30 -20
  226. data/rubygems-update.gemspec +5 -5
  227. data/setup.rb +1 -1
  228. metadata +36 -27
  229. data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
  230. data/bundler/lib/bundler/vendor/securerandom/LICENSE.txt +0 -22
  231. data/bundler/lib/bundler/vendor/securerandom/lib/random/formatter.rb +0 -373
  232. data/bundler/lib/bundler/vendor/uri/LICENSE.txt +0 -22
  233. data/lib/rubygems/vendor/net-http/LICENSE.txt +0 -22
  234. data/lib/rubygems/vendor/net-http/lib/net/http/backward.rb +0 -40
  235. data/lib/rubygems/vendor/resolv/LICENSE.txt +0 -22
  236. data/lib/rubygems/vendor/securerandom/LICENSE.txt +0 -22
  237. data/lib/rubygems/vendor/securerandom/lib/random/formatter.rb +0 -373
  238. data/lib/rubygems/vendor/timeout/LICENSE.txt +0 -22
  239. data/lib/rubygems/vendor/uri/LICENSE.txt +0 -22
  240. /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
  241. /data/{bundler → doc/bundler}/UPGRADING.md +0 -0
  242. /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
@@ -217,7 +217,7 @@ module Bundler
217
217
  method_option "full-index", type: :boolean, banner: "Fall back to using the single-file index of all gems"
218
218
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
219
219
  method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
220
- method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
220
+ method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
221
221
  method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
222
222
  method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
223
223
  method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
@@ -227,8 +227,8 @@ module Bundler
227
227
  method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
228
228
  method_option "standalone", type: :array, lazy_default: [], banner: "Make a bundle that can work without the Bundler runtime"
229
229
  method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
230
- method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of " +
231
- Bundler.rubygems.security_policy_keys.join("|")
230
+ method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of #{Bundler.rubygems.security_policy_keys.join("|")}"
231
+ method_option "target-rbconfig", type: :string, banner: "Path to rbconfig.rb for the deployment target platform"
232
232
  method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
233
233
  method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
234
234
  def install
@@ -286,10 +286,8 @@ module Bundler
286
286
  Show lists the names and versions of all gems that are required by your Gemfile.
287
287
  Calling show with [GEM] will list the exact location of that gem on your machine.
288
288
  D
289
- method_option "paths", type: :boolean,
290
- banner: "List the paths of all gems that are required by your Gemfile."
291
- method_option "outdated", type: :boolean,
292
- banner: "Show verbose output including whether gems are outdated."
289
+ method_option "paths", type: :boolean, banner: "List the paths of all gems that are required by your Gemfile."
290
+ method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
293
291
  def show(gem_name = nil)
294
292
  if ARGV.include?("--outdated")
295
293
  message = "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement"
@@ -351,6 +349,7 @@ module Bundler
351
349
  method_option "branch", type: :string
352
350
  method_option "ref", type: :string
353
351
  method_option "glob", type: :string, banner: "The location of a dependency's .gemspec, expanded within Ruby (single quotes recommended)"
352
+ method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
354
353
  method_option "skip-install", type: :boolean, banner: "Adds gem to the Gemfile but does not install it"
355
354
  method_option "optimistic", type: :boolean, banner: "Adds optimistic declaration of version to gem"
356
355
  method_option "strict", type: :boolean, banner: "Adds strict declaration of version to gem"
@@ -397,9 +396,7 @@ module Bundler
397
396
  end
398
397
 
399
398
  desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
400
- method_option "all", type: :boolean,
401
- default: Bundler.feature_flag.cache_all?,
402
- banner: "Include all sources (including path and git)."
399
+ method_option "all", type: :boolean, default: Bundler.feature_flag.cache_all?, banner: "Include all sources (including path and git)."
403
400
  method_option "all-platforms", type: :boolean, banner: "Include gems for all platforms present in the lockfile, not only the current one"
404
401
  method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
405
402
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
@@ -437,8 +434,8 @@ module Bundler
437
434
  map aliases_for("cache")
438
435
 
439
436
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
440
- method_option :keep_file_descriptors, type: :boolean, default: true
441
- method_option :gemfile, type: :string, required: false
437
+ method_option :keep_file_descriptors, type: :boolean, default: true, banner: "Passes all file descriptors to the new processes. Default is true, and setting it to false is deprecated"
438
+ method_option :gemfile, type: :string, required: false, banner: "Use the specified gemfile instead of Gemfile"
442
439
  long_desc <<-D
443
440
  Exec runs a command, providing it access to the gems in the bundle. While using
444
441
  bundle exec you can require and call the bundled gems as if they were installed
@@ -479,12 +476,10 @@ module Bundler
479
476
  Open.new(options, name).run
480
477
  end
481
478
 
482
- unless Bundler.feature_flag.bundler_3_mode?
483
- desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
484
- def console(group = nil)
485
- require_relative "cli/console"
486
- Console.new(options, group).run
487
- end
479
+ desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
480
+ def console(group = nil)
481
+ require_relative "cli/console"
482
+ Console.new(options, group).run
488
483
  end
489
484
 
490
485
  desc "version", "Prints Bundler version information"
@@ -536,55 +531,28 @@ module Bundler
536
531
  end
537
532
  end
538
533
 
539
- old_gem = instance_method(:gem)
540
-
541
534
  desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
542
535
  method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], desc: "Generate a binary executable for your library."
543
536
  method_option :coc, type: :boolean, desc: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
544
- method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR",
545
- lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
546
- desc: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
537
+ method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR", lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, desc: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
547
538
  method_option :ext, type: :string, desc: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
548
539
  method_option :git, type: :boolean, default: true, desc: "Initialize a git repo inside your library."
549
540
  method_option :mit, type: :boolean, desc: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
550
541
  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`."
551
542
  method_option :changelog, type: :boolean, desc: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
552
- method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library",
553
- enum: %w[rspec minitest test-unit],
554
- 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)`."
555
- method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "",
556
- enum: %w[github gitlab circle],
557
- desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
558
- method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "",
559
- enum: %w[rubocop standard],
560
- desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
543
+ method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library", enum: %w[rspec minitest test-unit], 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)`."
544
+ method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
545
+ method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
561
546
  method_option :github_username, type: :string, default: Bundler.settings["gem.github_username"], banner: "Set your username on GitHub", desc: "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
562
547
 
563
548
  def gem(name)
564
- end
549
+ require_relative "cli/gem"
550
+ cmd_args = args + [self]
551
+ cmd_args.unshift(options)
565
552
 
566
- commands["gem"].tap do |gem_command|
567
- def gem_command.run(instance, args = [])
568
- arity = 1 # name
569
-
570
- require_relative "cli/gem"
571
- cmd_args = args + [instance]
572
- cmd_args.unshift(instance.options)
573
-
574
- cmd = begin
575
- Gem.new(*cmd_args)
576
- rescue ArgumentError => e
577
- instance.class.handle_argument_error(self, e, args, arity)
578
- end
579
-
580
- cmd.run
581
- end
553
+ Gem.new(*cmd_args).run
582
554
  end
583
555
 
584
- undef_method(:gem)
585
- define_method(:gem, old_gem)
586
- private :gem
587
-
588
556
  def self.source_root
589
557
  File.expand_path("templates", __dir__)
590
558
  end
@@ -620,8 +588,10 @@ module Bundler
620
588
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
621
589
  method_option "lockfile", type: :string, default: nil, banner: "the path the lockfile should be written to"
622
590
  method_option "full-index", type: :boolean, default: false, banner: "Fall back to using the single-file index of all gems"
591
+ method_option "add-checksums", type: :boolean, default: false, banner: "Adds checksums to the lockfile"
623
592
  method_option "add-platform", type: :array, default: [], banner: "Add a new platform to the lockfile"
624
593
  method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
594
+ method_option "normalize-platforms", type: :boolean, default: false, banner: "Normalize lockfile platforms"
625
595
  method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
626
596
  method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
627
597
  method_option "major", type: :boolean, banner: "If updating, prefer updating to next major version (default)"
@@ -86,11 +86,6 @@ module Bundler
86
86
  end
87
87
  end
88
88
 
89
- # remove this method when we stop generating md5 digests for legacy etags
90
- def md5
91
- @digests && @digests["md5"]
92
- end
93
-
94
89
  def digests?
95
90
  @digests&.any?
96
91
  end
@@ -28,7 +28,6 @@ module Bundler
28
28
 
29
29
  CacheFile.copy(local_path) do |file|
30
30
  etag = etag_path.read.tap(&:chomp!) if etag_path.file?
31
- etag ||= generate_etag(etag_path, file) # Remove this after 2.5.0 has been out for a while.
32
31
 
33
32
  # Subtract a byte to ensure the range won't be empty.
34
33
  # Avoids 416 (Range Not Satisfiable) responses.
@@ -67,16 +66,6 @@ module Bundler
67
66
  etag_path.read.tap(&:chomp!) if etag_path.file?
68
67
  end
69
68
 
70
- # When first releasing this opaque etag feature, we want to generate the old MD5 etag
71
- # based on the content of the file. After that it will always use the saved opaque etag.
72
- # This transparently saves existing users with good caches from updating a bunch of files.
73
- # Remove this behavior after 2.5.0 has been out for a while.
74
- def generate_etag(etag_path, file)
75
- etag = file.md5.hexdigest
76
- CacheFile.write(etag_path, etag)
77
- etag
78
- end
79
-
80
69
  def etag_from_response(response)
81
70
  return unless response["ETag"]
82
71
  etag = response["ETag"].delete_prefix("W/")
@@ -13,13 +13,14 @@ module Bundler
13
13
 
14
14
  attr_reader(
15
15
  :dependencies,
16
+ :locked_checksums,
16
17
  :locked_deps,
17
18
  :locked_gems,
18
19
  :platforms,
19
20
  :ruby_version,
20
21
  :lockfile,
21
22
  :gemfiles,
22
- :locked_checksums
23
+ :sources
23
24
  )
24
25
 
25
26
  # Given a gemfile and lockfile creates a Bundler definition
@@ -88,6 +89,7 @@ module Bundler
88
89
  @lockfile_contents = Bundler.read_file(lockfile)
89
90
  @locked_gems = LockfileParser.new(@lockfile_contents)
90
91
  @locked_platforms = @locked_gems.platforms
92
+ @most_specific_locked_platform = @locked_gems.most_specific_locked_platform
91
93
  @platforms = @locked_platforms.dup
92
94
  @locked_bundler_version = @locked_gems.bundler_version
93
95
  @locked_ruby_version = @locked_gems.ruby_version
@@ -107,15 +109,16 @@ module Bundler
107
109
  end
108
110
  else
109
111
  @unlock = {}
110
- @platforms = []
111
112
  @locked_gems = nil
113
+ @locked_platforms = []
114
+ @most_specific_locked_platform = nil
115
+ @platforms = []
112
116
  @locked_deps = {}
113
117
  @locked_specs = SpecSet.new([])
114
118
  @originally_locked_deps = {}
115
119
  @originally_locked_specs = @locked_specs
116
120
  @locked_sources = []
117
- @locked_platforms = []
118
- @locked_checksums = Bundler.feature_flag.bundler_3_mode?
121
+ @locked_checksums = Bundler.feature_flag.lockfile_checksums?
119
122
  end
120
123
 
121
124
  locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
@@ -149,7 +152,7 @@ module Bundler
149
152
  @gems_to_unlock = @explicit_unlocks.any? ? @explicit_unlocks : @dependencies.map(&:name)
150
153
  else
151
154
  eager_unlock = @explicit_unlocks.map {|name| Dependency.new(name, ">= 0") }
152
- @gems_to_unlock = @locked_specs.for(eager_unlock, false, platforms).map(&:name).uniq
155
+ @gems_to_unlock = @locked_specs.for(eager_unlock, platforms).map(&:name).uniq
153
156
  end
154
157
 
155
158
  @dependency_changes = converge_dependencies
@@ -162,21 +165,57 @@ module Bundler
162
165
  @gem_version_promoter ||= GemVersionPromoter.new
163
166
  end
164
167
 
165
- def resolve_only_locally!
168
+ def check!
169
+ # If dependencies have changed, we need to resolve remotely. Otherwise,
170
+ # since we'll be resolving with a single local source, we may end up
171
+ # locking gems under the wrong source in the lockfile, and missing lockfile
172
+ # checksums
173
+ resolve_remotely! if @dependency_changes
174
+
175
+ # Now do a local only resolve, to verify if any gems are missing locally
166
176
  sources.local_only!
167
177
  resolve
168
178
  end
169
179
 
180
+ #
181
+ # Setup sources according to the given options and the state of the
182
+ # definition.
183
+ #
184
+ # @return [Boolean] Whether fetching remote information will be necessary or not
185
+ #
186
+ def setup_domain!(options = {})
187
+ prefer_local! if options[:"prefer-local"]
188
+
189
+ if options[:local] || no_install_needed?
190
+ Bundler.settings.set_command_option(:jobs, 1) if no_install_needed? # to avoid the overhead of Bundler::Worker
191
+ with_cache!
192
+ false
193
+ else
194
+ remotely!
195
+ true
196
+ end
197
+ end
198
+
170
199
  def resolve_with_cache!
200
+ with_cache!
201
+
202
+ resolve
203
+ end
204
+
205
+ def with_cache!
171
206
  sources.local!
172
207
  sources.cached!
173
- resolve
174
208
  end
175
209
 
176
210
  def resolve_remotely!
211
+ remotely!
212
+
213
+ resolve
214
+ end
215
+
216
+ def remotely!
177
217
  sources.cached!
178
218
  sources.remote!
179
- resolve
180
219
  end
181
220
 
182
221
  def prefer_local!
@@ -202,7 +241,7 @@ module Bundler
202
241
  end
203
242
 
204
243
  def missing_specs
205
- resolve.materialize(requested_dependencies).missing_specs
244
+ resolve.missing_specs_for(requested_dependencies)
206
245
  end
207
246
 
208
247
  def missing_specs?
@@ -266,11 +305,7 @@ module Bundler
266
305
  groups.map!(&:to_sym)
267
306
  deps = current_dependencies # always returns a new array
268
307
  deps.select! do |d|
269
- if RUBY_VERSION >= "3.1"
270
- d.groups.intersect?(groups)
271
- else
272
- !(d.groups & groups).empty?
273
- end
308
+ d.groups.intersect?(groups)
274
309
  end
275
310
  deps
276
311
  end
@@ -308,11 +343,11 @@ module Bundler
308
343
  end
309
344
 
310
345
  def spec_git_paths
311
- sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
346
+ sources.git_sources.filter_map {|s| File.realpath(s.path) if File.exist?(s.path) }
312
347
  end
313
348
 
314
349
  def groups
315
- dependencies.map(&:groups).flatten.uniq
350
+ dependencies.flat_map(&:groups).uniq
316
351
  end
317
352
 
318
353
  def lock(file_or_preserve_unknown_sections = false, preserve_unknown_sections_or_unused = false)
@@ -457,6 +492,12 @@ module Bundler
457
492
  "Add the current platform to the lockfile with\n`bundle lock --add-platform #{local_platform}` and try again."
458
493
  end
459
494
 
495
+ def normalize_platforms
496
+ @platforms = resolve.normalize_platforms!(current_dependencies, platforms)
497
+
498
+ @resolve = SpecSet.new(resolve.for(current_dependencies, @platforms))
499
+ end
500
+
460
501
  def add_platform(platform)
461
502
  return if @platforms.include?(platform)
462
503
 
@@ -471,12 +512,6 @@ module Bundler
471
512
  raise InvalidOption, "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}"
472
513
  end
473
514
 
474
- def most_specific_locked_platform
475
- @platforms.min_by do |bundle_platform|
476
- platform_specificity_match(bundle_platform, local_platform)
477
- end
478
- end
479
-
480
515
  def nothing_changed?
481
516
  return false unless lockfile_exists?
482
517
 
@@ -492,6 +527,10 @@ module Bundler
492
527
  !@locked_spec_with_invalid_deps
493
528
  end
494
529
 
530
+ def no_install_needed?
531
+ no_resolve_needed? && !missing_specs?
532
+ end
533
+
495
534
  def no_resolve_needed?
496
535
  !unlocking? && nothing_changed?
497
536
  end
@@ -502,9 +541,15 @@ module Bundler
502
541
 
503
542
  attr_writer :source_requirements
504
543
 
505
- private
544
+ def add_checksums
545
+ @locked_checksums = true
546
+
547
+ setup_domain!
506
548
 
507
- attr_reader :sources
549
+ specs # force materialization to real specifications, so that checksums are fetched
550
+ end
551
+
552
+ private
508
553
 
509
554
  def should_add_extra_platforms?
510
555
  !lockfile_exists? && generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform]
@@ -549,7 +594,7 @@ module Bundler
549
594
  end
550
595
 
551
596
  def resolver
552
- @resolver ||= Resolver.new(resolution_packages, gem_version_promoter)
597
+ @resolver ||= Resolver.new(resolution_packages, gem_version_promoter, @most_specific_locked_platform)
553
598
  end
554
599
 
555
600
  def expanded_dependencies
@@ -558,7 +603,7 @@ module Bundler
558
603
 
559
604
  def dependencies_with_bundler
560
605
  return dependencies unless @unlocking_bundler
561
- return dependencies if dependencies.map(&:name).include?("bundler")
606
+ return dependencies if dependencies.any? {|d| d.name == "bundler" }
562
607
 
563
608
  [Dependency.new("bundler", @unlocking_bundler)] + dependencies
564
609
  end
@@ -574,22 +619,46 @@ module Bundler
574
619
  end
575
620
  end
576
621
 
577
- def filter_specs(specs, deps)
578
- SpecSet.new(specs).for(deps, false, platforms)
622
+ def filter_specs(specs, deps, skips: [])
623
+ SpecSet.new(specs).for(deps, platforms, skips: skips)
579
624
  end
580
625
 
581
626
  def materialize(dependencies)
582
- specs = resolve.materialize(dependencies)
583
- missing_specs = specs.missing_specs
627
+ # Tracks potential endless loops trying to re-resolve.
628
+ # TODO: Remove as dead code if not reports are received in a while
629
+ incorrect_spec = nil
630
+
631
+ specs = begin
632
+ resolve.materialize(dependencies)
633
+ rescue IncorrectLockfileDependencies => e
634
+ spec = e.spec
635
+ raise "Infinite loop while fixing lockfile dependencies" if incorrect_spec == spec
636
+
637
+ incorrect_spec = spec
638
+ reresolve_without([spec])
639
+ retry
640
+ end
641
+
642
+ missing_specs = resolve.missing_specs
584
643
 
585
644
  if missing_specs.any?
586
645
  missing_specs.each do |s|
587
646
  locked_gem = @locked_specs[s.name].last
588
647
  next if locked_gem.nil? || locked_gem.version != s.version || sources.local_mode?
589
- raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
590
- "no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
591
- "You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
592
- "removed in order to install."
648
+
649
+ message = if sources.implicit_global_source?
650
+ "Because your Gemfile specifies no global remote source, your bundle is locked to " \
651
+ "#{locked_gem} from #{locked_gem.source}. However, #{locked_gem} is not installed. You'll " \
652
+ "need to either add a global remote source to your Gemfile or make sure #{locked_gem} is " \
653
+ "available locally before rerunning Bundler."
654
+ else
655
+ "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
656
+ "no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
657
+ "You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
658
+ "removed in order to install."
659
+ end
660
+
661
+ raise GemNotFound, message
593
662
  end
594
663
 
595
664
  missing_specs_list = missing_specs.group_by(&:source).map do |source, missing_specs_for_source|
@@ -599,17 +668,24 @@ module Bundler
599
668
  raise GemNotFound, "Could not find #{missing_specs_list.join(" nor ")}"
600
669
  end
601
670
 
602
- incomplete_specs = specs.incomplete_specs
671
+ partially_missing_specs = resolve.partially_missing_specs
672
+
673
+ if partially_missing_specs.any? && !sources.local_mode?
674
+ Bundler.ui.warn "Some locked specs have possibly been yanked (#{partially_missing_specs.map(&:full_name).join(", ")}). Ignoring them..."
675
+
676
+ resolve.delete(partially_missing_specs)
677
+ end
678
+
679
+ incomplete_specs = resolve.incomplete_specs
603
680
  loop do
604
681
  break if incomplete_specs.empty?
605
682
 
606
683
  Bundler.ui.debug("The lockfile does not have all gems needed for the current platform though, Bundler will still re-resolve dependencies")
607
684
  sources.remote!
608
- resolution_packages.delete(incomplete_specs)
609
- @resolve = start_resolution
685
+ reresolve_without(incomplete_specs)
610
686
  specs = resolve.materialize(dependencies)
611
687
 
612
- still_incomplete_specs = specs.incomplete_specs
688
+ still_incomplete_specs = resolve.incomplete_specs
613
689
 
614
690
  if still_incomplete_specs == incomplete_specs
615
691
  package = resolution_packages.get_package(incomplete_specs.first.name)
@@ -619,12 +695,26 @@ module Bundler
619
695
  incomplete_specs = still_incomplete_specs
620
696
  end
621
697
 
698
+ insecurely_materialized_specs = resolve.insecurely_materialized_specs
699
+
700
+ if insecurely_materialized_specs.any?
701
+ Bundler.ui.warn "The following platform specific gems are getting installed, yet the lockfile includes only their generic ruby version:\n" \
702
+ " * #{insecurely_materialized_specs.map(&:full_name).join("\n * ")}\n" \
703
+ "Please run `bundle lock --normalize-platforms` and commit the resulting lockfile.\n" \
704
+ "Alternatively, you may run `bundle lock --add-platform <list-of-platforms-that-you-want-to-support>`"
705
+ end
706
+
622
707
  bundler = sources.metadata_source.specs.search(["bundler", Bundler.gem_version]).last
623
708
  specs["bundler"] = bundler
624
709
 
625
710
  specs
626
711
  end
627
712
 
713
+ def reresolve_without(incomplete_specs)
714
+ resolution_packages.delete(incomplete_specs)
715
+ @resolve = start_resolution
716
+ end
717
+
628
718
  def start_resolution
629
719
  local_platform_needed_for_resolvability = @most_specific_non_local_locked_ruby_platform && !@platforms.include?(local_platform)
630
720
  @platforms << local_platform if local_platform_needed_for_resolvability
@@ -644,7 +734,7 @@ module Bundler
644
734
 
645
735
  @platforms = result.add_extra_platforms!(platforms) if should_add_extra_platforms?
646
736
 
647
- SpecSet.new(result.for(dependencies, false, @platforms))
737
+ SpecSet.new(result.for(dependencies, @platforms))
648
738
  end
649
739
 
650
740
  def precompute_source_requirements_for_indirect_dependencies?
@@ -670,7 +760,7 @@ module Bundler
670
760
  def find_most_specific_locked_ruby_platform
671
761
  return unless generic_local_platform_is_ruby? && current_platform_locked?
672
762
 
673
- most_specific_locked_platform
763
+ @most_specific_locked_platform
674
764
  end
675
765
 
676
766
  def change_reason
@@ -871,7 +961,7 @@ module Bundler
871
961
  def converge_locked_specs
872
962
  converged = converge_specs(@locked_specs)
873
963
 
874
- resolve = SpecSet.new(converged.reject {|s| @gems_to_unlock.include?(s.name) })
964
+ resolve = SpecSet.new(converged)
875
965
 
876
966
  diff = nil
877
967
 
@@ -892,8 +982,6 @@ module Bundler
892
982
  converged = []
893
983
  deps = []
894
984
 
895
- @specs_that_changed_sources = []
896
-
897
985
  specs.each do |s|
898
986
  name = s.name
899
987
  dep = @dependencies.find {|d| s.satisfies?(d) }
@@ -902,9 +990,7 @@ module Bundler
902
990
  if dep
903
991
  gemfile_source = dep.source || default_source
904
992
 
905
- @specs_that_changed_sources << s if gemfile_source != lockfile_source
906
- deps << dep if !dep.source || lockfile_source.include?(dep.source)
907
- @gems_to_unlock << name if lockfile_source.include?(dep.source) && lockfile_source != gemfile_source
993
+ deps << dep if !dep.source || lockfile_source.include?(dep.source) || new_deps.include?(dep)
908
994
 
909
995
  # Replace the locked dependency's source with the equivalent source from the Gemfile
910
996
  s.source = gemfile_source
@@ -913,25 +999,14 @@ module Bundler
913
999
  s.source = default_source unless sources.get(lockfile_source)
914
1000
  end
915
1001
 
916
- next if @sources_to_unlock.include?(s.source.name)
1002
+ source = s.source
1003
+ next if @sources_to_unlock.include?(source.name)
917
1004
 
918
1005
  # Path sources have special logic
919
- if s.source.instance_of?(Source::Path) || s.source.instance_of?(Source::Gemspec)
920
- new_specs = begin
921
- s.source.specs
922
- rescue PathError
923
- # if we won't need the source (according to the lockfile),
924
- # don't error if the path source isn't available
925
- next if specs.
926
- for(requested_dependencies, false).
927
- none? {|locked_spec| locked_spec.source == s.source }
928
-
929
- raise
930
- end
931
-
932
- new_spec = new_specs[s].first
1006
+ if source.instance_of?(Source::Path) || source.instance_of?(Source::Gemspec) || (source.instance_of?(Source::Git) && !@gems_to_unlock.include?(name) && deps.include?(dep))
1007
+ new_spec = source.specs[s].first
933
1008
  if new_spec
934
- s.dependencies.replace(new_spec.dependencies)
1009
+ s.runtime_dependencies.replace(new_spec.runtime_dependencies)
935
1010
  else
936
1011
  # If the spec is no longer in the path source, unlock it. This
937
1012
  # commonly happens if the version changed in the gemspec
@@ -939,14 +1014,15 @@ module Bundler
939
1014
  end
940
1015
  end
941
1016
 
942
- if dep.nil? && requested_dependencies.find {|d| name == d.name }
943
- @gems_to_unlock << s.name
944
- else
945
- converged << s
1017
+ if dep.nil? && requested_dep = requested_dependencies.find {|d| name == d.name }
1018
+ @gems_to_unlock << name
1019
+ deps << requested_dep
946
1020
  end
1021
+
1022
+ converged << s
947
1023
  end
948
1024
 
949
- filter_specs(converged, deps)
1025
+ filter_specs(converged, deps, skips: @gems_to_unlock)
950
1026
  end
951
1027
 
952
1028
  def metadata_dependencies
@@ -984,7 +1060,6 @@ module Bundler
984
1060
  source_requirements["bundler"] = sources.metadata_source # needs to come last to override
985
1061
  end
986
1062
 
987
- verify_changed_sources!
988
1063
  source_requirements
989
1064
  end
990
1065
 
@@ -992,14 +1067,6 @@ module Bundler
992
1067
  sources.default_source
993
1068
  end
994
1069
 
995
- def verify_changed_sources!
996
- @specs_that_changed_sources.each do |s|
997
- if s.source.specs.search(s.name).empty?
998
- raise GemNotFound, "Could not find gem '#{s.name}' in #{s.source}"
999
- end
1000
- end
1001
- end
1002
-
1003
1070
  def requested_groups
1004
1071
  values = groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
1005
1072
  values &= Bundler.settings[:only] unless Bundler.settings[:only].empty?
@@ -62,7 +62,7 @@ module Bundler
62
62
  end
63
63
 
64
64
  def expanded_platforms
65
- @expanded_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.flatten.uniq
65
+ @expanded_platforms ||= @platforms.filter_map {|pl| PLATFORM_MAP[pl] }.flatten.uniq
66
66
  end
67
67
 
68
68
  def should_include?