bundler 2.5.16 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +194 -0
  3. data/bundler.gemspec +2 -2
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli/add.rb +3 -1
  6. data/lib/bundler/cli/check.rb +3 -3
  7. data/lib/bundler/cli/console.rb +0 -4
  8. data/lib/bundler/cli/doctor.rb +4 -4
  9. data/lib/bundler/cli/exec.rb +1 -0
  10. data/lib/bundler/cli/gem.rb +6 -3
  11. data/lib/bundler/cli/info.rb +2 -2
  12. data/lib/bundler/cli/inject.rb +1 -1
  13. data/lib/bundler/cli/install.rb +13 -4
  14. data/lib/bundler/cli/lock.rb +25 -6
  15. data/lib/bundler/cli/outdated.rb +16 -18
  16. data/lib/bundler/cli/pristine.rb +1 -1
  17. data/lib/bundler/cli/show.rb +2 -2
  18. data/lib/bundler/cli.rb +38 -68
  19. data/lib/bundler/compact_index_client/cache_file.rb +0 -5
  20. data/lib/bundler/compact_index_client/updater.rb +0 -11
  21. data/lib/bundler/definition.rb +186 -119
  22. data/lib/bundler/dependency.rb +1 -1
  23. data/lib/bundler/dsl.rb +67 -52
  24. data/lib/bundler/endpoint_specification.rb +10 -1
  25. data/lib/bundler/errors.rb +17 -5
  26. data/lib/bundler/feature_flag.rb +1 -0
  27. data/lib/bundler/fetcher/compact_index.rb +1 -1
  28. data/lib/bundler/fetcher.rb +12 -5
  29. data/lib/bundler/force_platform.rb +0 -2
  30. data/lib/bundler/gem_helpers.rb +21 -5
  31. data/lib/bundler/injector.rb +2 -2
  32. data/lib/bundler/inline.rb +42 -17
  33. data/lib/bundler/installer/gem_installer.rb +4 -2
  34. data/lib/bundler/installer/parallel_installer.rb +3 -2
  35. data/lib/bundler/installer/standalone.rb +2 -2
  36. data/lib/bundler/installer.rb +11 -47
  37. data/lib/bundler/lazy_specification.rb +74 -26
  38. data/lib/bundler/lockfile_generator.rb +1 -1
  39. data/lib/bundler/lockfile_parser.rb +10 -2
  40. data/lib/bundler/man/bundle-add.1 +42 -25
  41. data/lib/bundler/man/bundle-add.1.ronn +52 -23
  42. data/lib/bundler/man/bundle-binstubs.1 +7 -4
  43. data/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
  44. data/lib/bundler/man/bundle-cache.1 +30 -2
  45. data/lib/bundler/man/bundle-cache.1.ronn +31 -2
  46. data/lib/bundler/man/bundle-check.1 +3 -3
  47. data/lib/bundler/man/bundle-check.1.ronn +4 -2
  48. data/lib/bundler/man/bundle-clean.1 +1 -1
  49. data/lib/bundler/man/bundle-config.1 +3 -5
  50. data/lib/bundler/man/bundle-config.1.ronn +2 -7
  51. data/lib/bundler/man/bundle-console.1 +2 -4
  52. data/lib/bundler/man/bundle-console.1.ronn +2 -7
  53. data/lib/bundler/man/bundle-doctor.1 +2 -2
  54. data/lib/bundler/man/bundle-doctor.1.ronn +1 -1
  55. data/lib/bundler/man/bundle-env.1 +9 -0
  56. data/lib/bundler/man/bundle-env.1.ronn +10 -0
  57. data/lib/bundler/man/bundle-exec.1 +5 -2
  58. data/lib/bundler/man/bundle-exec.1.ronn +4 -1
  59. data/lib/bundler/man/bundle-fund.1 +22 -0
  60. data/lib/bundler/man/bundle-fund.1.ronn +25 -0
  61. data/lib/bundler/man/bundle-gem.1 +17 -5
  62. data/lib/bundler/man/bundle-gem.1.ronn +27 -6
  63. data/lib/bundler/man/bundle-help.1 +1 -1
  64. data/lib/bundler/man/bundle-info.1 +5 -2
  65. data/lib/bundler/man/bundle-info.1.ronn +6 -2
  66. data/lib/bundler/man/bundle-init.1 +3 -3
  67. data/lib/bundler/man/bundle-init.1.ronn +3 -2
  68. data/lib/bundler/man/bundle-inject.1 +10 -2
  69. data/lib/bundler/man/bundle-inject.1.ronn +9 -1
  70. data/lib/bundler/man/bundle-install.1 +15 -12
  71. data/lib/bundler/man/bundle-install.1.ronn +22 -18
  72. data/lib/bundler/man/bundle-issue.1 +45 -0
  73. data/lib/bundler/man/bundle-issue.1.ronn +37 -0
  74. data/lib/bundler/man/bundle-licenses.1 +9 -0
  75. data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  76. data/lib/bundler/man/bundle-list.1 +1 -1
  77. data/lib/bundler/man/bundle-list.1.ronn +4 -1
  78. data/lib/bundler/man/bundle-lock.1 +21 -6
  79. data/lib/bundler/man/bundle-lock.1.ronn +25 -4
  80. data/lib/bundler/man/bundle-open.1 +2 -2
  81. data/lib/bundler/man/bundle-open.1.ronn +2 -1
  82. data/lib/bundler/man/bundle-outdated.1 +8 -5
  83. data/lib/bundler/man/bundle-outdated.1.ronn +8 -4
  84. data/lib/bundler/man/bundle-platform.1 +1 -1
  85. data/lib/bundler/man/bundle-plugin.1 +1 -1
  86. data/lib/bundler/man/bundle-pristine.1 +1 -1
  87. data/lib/bundler/man/bundle-pristine.1.ronn +1 -1
  88. data/lib/bundler/man/bundle-remove.1 +1 -1
  89. data/lib/bundler/man/bundle-remove.1.ronn +1 -1
  90. data/lib/bundler/man/bundle-show.1 +5 -2
  91. data/lib/bundler/man/bundle-show.1.ronn +4 -0
  92. data/lib/bundler/man/bundle-update.1 +13 -7
  93. data/lib/bundler/man/bundle-update.1.ronn +14 -6
  94. data/lib/bundler/man/bundle-version.1 +1 -1
  95. data/lib/bundler/man/bundle-viz.1 +4 -4
  96. data/lib/bundler/man/bundle-viz.1.ronn +7 -3
  97. data/lib/bundler/man/bundle.1 +1 -1
  98. data/lib/bundler/man/gemfile.5 +3 -1
  99. data/lib/bundler/man/gemfile.5.ronn +6 -0
  100. data/lib/bundler/man/index.txt +4 -0
  101. data/lib/bundler/materialization.rb +59 -0
  102. data/lib/bundler/plugin/api/source.rb +2 -1
  103. data/lib/bundler/plugin/events.rb +24 -0
  104. data/lib/bundler/plugin/installer.rb +1 -1
  105. data/lib/bundler/plugin.rb +20 -1
  106. data/lib/bundler/process_lock.rb +10 -14
  107. data/lib/bundler/remote_specification.rb +6 -1
  108. data/lib/bundler/resolver/base.rb +12 -6
  109. data/lib/bundler/resolver/candidate.rb +2 -2
  110. data/lib/bundler/resolver/package.rb +10 -1
  111. data/lib/bundler/resolver/spec_group.rb +4 -3
  112. data/lib/bundler/resolver.rb +36 -14
  113. data/lib/bundler/retry.rb +1 -1
  114. data/lib/bundler/ruby_version.rb +7 -1
  115. data/lib/bundler/rubygems_ext.rb +104 -51
  116. data/lib/bundler/rubygems_gem_installer.rb +7 -5
  117. data/lib/bundler/rubygems_integration.rb +23 -62
  118. data/lib/bundler/runtime.rb +22 -7
  119. data/lib/bundler/self_manager.rb +7 -7
  120. data/lib/bundler/settings.rb +6 -1
  121. data/lib/bundler/shared_helpers.rb +29 -17
  122. data/lib/bundler/source/git/git_proxy.rb +0 -2
  123. data/lib/bundler/source/git.rb +93 -40
  124. data/lib/bundler/source/metadata.rb +2 -3
  125. data/lib/bundler/source/path.rb +5 -3
  126. data/lib/bundler/source/rubygems.rb +6 -16
  127. data/lib/bundler/source_list.rb +1 -1
  128. data/lib/bundler/spec_set.rb +82 -57
  129. data/lib/bundler/stub_specification.rb +21 -2
  130. data/lib/bundler/templates/newgem/Gemfile.tt +0 -3
  131. data/lib/bundler/templates/newgem/README.md.tt +7 -3
  132. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +15 -15
  133. data/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -4
  134. data/lib/bundler/ui/shell.rb +24 -2
  135. data/lib/bundler/ui/silent.rb +12 -1
  136. data/lib/bundler/uri_credentials_filter.rb +1 -1
  137. data/lib/bundler/vendor/fileutils/COPYING +56 -0
  138. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
  139. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +46 -8
  140. data/lib/bundler/vendor/securerandom/.document +1 -0
  141. data/lib/bundler/vendor/securerandom/COPYING +56 -0
  142. data/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
  143. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
  144. data/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
  145. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
  146. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
  147. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
  148. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
  149. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
  150. data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
  151. data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  152. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  153. data/lib/bundler/vendor/thor/lib/thor.rb +11 -0
  154. data/lib/bundler/vendor/uri/COPYING +56 -0
  155. data/lib/bundler/vendor/uri/lib/uri/common.rb +37 -14
  156. data/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
  157. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
  158. data/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
  159. data/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
  160. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
  161. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
  162. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  163. data/lib/bundler/vendor/uri/lib/uri.rb +9 -9
  164. data/lib/bundler/vendored_securerandom.rb +12 -0
  165. data/lib/bundler/version.rb +1 -1
  166. data/lib/bundler/yaml_serializer.rb +1 -1
  167. data/lib/bundler.rb +68 -36
  168. metadata +20 -10
  169. data/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
  170. data/lib/bundler/vendor/uri/LICENSE.txt +0 -22
data/lib/bundler/cli.rb CHANGED
@@ -110,8 +110,8 @@ module Bundler
110
110
  default_task(Bundler.feature_flag.default_cli_command)
111
111
 
112
112
  class_option "no-color", type: :boolean, desc: "Disable colorization in output"
113
- class_option "retry", type: :numeric, aliases: "-r", banner: "NUM",
114
- desc: "Specify the number of times you wish to attempt network commands"
113
+ class_option "retry", type: :numeric, aliases: "-r", banner: "NUM",
114
+ desc: "Specify the number of times you wish to attempt network commands"
115
115
  class_option "verbose", type: :boolean, desc: "Enable verbose output mode", aliases: "-V"
116
116
 
117
117
  def help(cli = nil)
@@ -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
@@ -260,15 +260,15 @@ module Bundler
260
260
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
261
261
  method_option "group", aliases: "-g", type: :array, banner: "Update a specific group"
262
262
  method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
263
- method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
264
- method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
263
+ method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
264
+ method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
265
265
  method_option "source", type: :array, banner: "Update a specific source (and all gems associated with it)"
266
266
  method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
267
267
  method_option "ruby", type: :boolean, banner: "Update ruby specified in Gemfile.lock"
268
268
  method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
269
- method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
270
- method_option "minor", type: :boolean, banner: "Prefer updating only to next minor version"
271
- method_option "major", type: :boolean, banner: "Prefer updating to next major version (default)"
269
+ method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
270
+ method_option "minor", type: :boolean, banner: "Prefer updating only to next minor version"
271
+ method_option "major", type: :boolean, banner: "Prefer updating to next major version (default)"
272
272
  method_option "pre", type: :boolean, banner: "Always choose the highest allowed version when updating gems, regardless of prerelease status"
273
273
  method_option "strict", type: :boolean, banner: "Do not allow any gem to be updated past latest --patch | --minor | --major"
274
274
  method_option "conservative", type: :boolean, banner: "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
@@ -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,11 +396,9 @@ 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
- method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
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"
406
403
  method_option "no-install", type: :boolean, banner: "Don't install the gems, only update the cache."
407
404
  method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
@@ -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
565
-
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)
549
+ require_relative "cli/gem"
550
+ cmd_args = args + [self]
551
+ cmd_args.unshift(options)
573
552
 
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
@@ -605,7 +573,7 @@ module Bundler
605
573
  end
606
574
 
607
575
  desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", hide: true
608
- method_option "source", type: :string, banner: "Install gem from the given source"
576
+ method_option "source", type: :string, banner: "Install gem from the given source"
609
577
  method_option "group", type: :string, banner: "Install gem into a bundler group"
610
578
  def inject(name, version)
611
579
  SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
@@ -615,16 +583,18 @@ module Bundler
615
583
 
616
584
  desc "lock", "Creates a lockfile without installing"
617
585
  method_option "update", type: :array, lazy_default: true, banner: "ignore the existing lockfile, update all gems by default, or update list of given gems"
618
- method_option "local", type: :boolean, default: false, banner: "do not attempt to fetch remote gemspecs and use the local gem cache only"
619
- method_option "print", type: :boolean, default: false, banner: "print the lockfile to STDOUT instead of writing to the file system"
586
+ method_option "local", type: :boolean, default: false, banner: "do not attempt to fetch remote gemspecs and use the local gem cache only"
587
+ method_option "print", type: :boolean, default: false, banner: "print the lockfile to STDOUT instead of writing to the file system"
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
- method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
625
- method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
626
- method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
627
- method_option "major", type: :boolean, banner: "If updating, prefer updating to next major version (default)"
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"
595
+ method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
596
+ method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
597
+ method_option "major", type: :boolean, banner: "If updating, prefer updating to next major version (default)"
628
598
  method_option "pre", type: :boolean, banner: "If updating, always choose the highest allowed version, regardless of prerelease status"
629
599
  method_option "strict", type: :boolean, banner: "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
630
600
  method_option "conservative", type: :boolean, banner: "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
@@ -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/")