bundler 2.5.23 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +59 -0
  3. data/bundler.gemspec +2 -2
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli/console.rb +0 -4
  6. data/lib/bundler/cli/doctor.rb +4 -4
  7. data/lib/bundler/cli/exec.rb +1 -0
  8. data/lib/bundler/cli/gem.rb +1 -1
  9. data/lib/bundler/cli/info.rb +2 -2
  10. data/lib/bundler/cli/inject.rb +1 -1
  11. data/lib/bundler/cli/install.rb +4 -0
  12. data/lib/bundler/cli/lock.rb +20 -1
  13. data/lib/bundler/cli/pristine.rb +1 -1
  14. data/lib/bundler/cli/show.rb +2 -2
  15. data/lib/bundler/cli.rb +22 -53
  16. data/lib/bundler/compact_index_client/cache_file.rb +0 -5
  17. data/lib/bundler/compact_index_client/updater.rb +0 -11
  18. data/lib/bundler/definition.rb +134 -61
  19. data/lib/bundler/dependency.rb +1 -1
  20. data/lib/bundler/dsl.rb +2 -13
  21. data/lib/bundler/endpoint_specification.rb +10 -1
  22. data/lib/bundler/errors.rb +10 -0
  23. data/lib/bundler/feature_flag.rb +1 -0
  24. data/lib/bundler/fetcher/compact_index.rb +1 -1
  25. data/lib/bundler/fetcher.rb +10 -3
  26. data/lib/bundler/gem_helpers.rb +21 -5
  27. data/lib/bundler/injector.rb +2 -2
  28. data/lib/bundler/installer/standalone.rb +2 -2
  29. data/lib/bundler/installer.rb +4 -38
  30. data/lib/bundler/lazy_specification.rb +65 -24
  31. data/lib/bundler/lockfile_parser.rb +9 -1
  32. data/lib/bundler/man/bundle-add.1 +13 -10
  33. data/lib/bundler/man/bundle-add.1.ronn +12 -9
  34. data/lib/bundler/man/bundle-binstubs.1 +7 -4
  35. data/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
  36. data/lib/bundler/man/bundle-cache.1 +30 -2
  37. data/lib/bundler/man/bundle-cache.1.ronn +31 -2
  38. data/lib/bundler/man/bundle-check.1 +3 -3
  39. data/lib/bundler/man/bundle-check.1.ronn +4 -2
  40. data/lib/bundler/man/bundle-clean.1 +1 -1
  41. data/lib/bundler/man/bundle-config.1 +3 -1
  42. data/lib/bundler/man/bundle-config.1.ronn +2 -0
  43. data/lib/bundler/man/bundle-console.1 +2 -4
  44. data/lib/bundler/man/bundle-console.1.ronn +2 -7
  45. data/lib/bundler/man/bundle-doctor.1 +2 -2
  46. data/lib/bundler/man/bundle-doctor.1.ronn +1 -1
  47. data/lib/bundler/man/bundle-env.1 +9 -0
  48. data/lib/bundler/man/bundle-env.1.ronn +10 -0
  49. data/lib/bundler/man/bundle-exec.1 +5 -2
  50. data/lib/bundler/man/bundle-exec.1.ronn +4 -1
  51. data/lib/bundler/man/bundle-fund.1 +22 -0
  52. data/lib/bundler/man/bundle-fund.1.ronn +25 -0
  53. data/lib/bundler/man/bundle-gem.1 +17 -5
  54. data/lib/bundler/man/bundle-gem.1.ronn +27 -6
  55. data/lib/bundler/man/bundle-help.1 +1 -1
  56. data/lib/bundler/man/bundle-info.1 +5 -2
  57. data/lib/bundler/man/bundle-info.1.ronn +6 -2
  58. data/lib/bundler/man/bundle-init.1 +3 -3
  59. data/lib/bundler/man/bundle-init.1.ronn +3 -2
  60. data/lib/bundler/man/bundle-inject.1 +10 -2
  61. data/lib/bundler/man/bundle-inject.1.ronn +9 -1
  62. data/lib/bundler/man/bundle-install.1 +14 -11
  63. data/lib/bundler/man/bundle-install.1.ronn +21 -16
  64. data/lib/bundler/man/bundle-issue.1 +45 -0
  65. data/lib/bundler/man/bundle-issue.1.ronn +37 -0
  66. data/lib/bundler/man/bundle-licenses.1 +9 -0
  67. data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  68. data/lib/bundler/man/bundle-list.1 +1 -1
  69. data/lib/bundler/man/bundle-list.1.ronn +4 -1
  70. data/lib/bundler/man/bundle-lock.1 +21 -6
  71. data/lib/bundler/man/bundle-lock.1.ronn +25 -4
  72. data/lib/bundler/man/bundle-open.1 +2 -2
  73. data/lib/bundler/man/bundle-open.1.ronn +2 -1
  74. data/lib/bundler/man/bundle-outdated.1 +8 -5
  75. data/lib/bundler/man/bundle-outdated.1.ronn +8 -4
  76. data/lib/bundler/man/bundle-platform.1 +1 -1
  77. data/lib/bundler/man/bundle-plugin.1 +1 -1
  78. data/lib/bundler/man/bundle-pristine.1 +1 -1
  79. data/lib/bundler/man/bundle-pristine.1.ronn +1 -1
  80. data/lib/bundler/man/bundle-remove.1 +1 -1
  81. data/lib/bundler/man/bundle-remove.1.ronn +1 -1
  82. data/lib/bundler/man/bundle-show.1 +5 -2
  83. data/lib/bundler/man/bundle-show.1.ronn +4 -0
  84. data/lib/bundler/man/bundle-update.1 +13 -7
  85. data/lib/bundler/man/bundle-update.1.ronn +14 -6
  86. data/lib/bundler/man/bundle-version.1 +1 -1
  87. data/lib/bundler/man/bundle-viz.1 +4 -4
  88. data/lib/bundler/man/bundle-viz.1.ronn +7 -3
  89. data/lib/bundler/man/bundle.1 +1 -1
  90. data/lib/bundler/man/gemfile.5 +1 -1
  91. data/lib/bundler/man/index.txt +4 -0
  92. data/lib/bundler/materialization.rb +59 -0
  93. data/lib/bundler/plugin/events.rb +24 -0
  94. data/lib/bundler/plugin/installer.rb +1 -1
  95. data/lib/bundler/process_lock.rb +1 -1
  96. data/lib/bundler/remote_specification.rb +6 -1
  97. data/lib/bundler/resolver/base.rb +2 -6
  98. data/lib/bundler/resolver/candidate.rb +2 -2
  99. data/lib/bundler/resolver/spec_group.rb +4 -3
  100. data/lib/bundler/resolver.rb +5 -5
  101. data/lib/bundler/rubygems_ext.rb +17 -28
  102. data/lib/bundler/rubygems_gem_installer.rb +0 -1
  103. data/lib/bundler/rubygems_integration.rb +21 -11
  104. data/lib/bundler/runtime.rb +27 -7
  105. data/lib/bundler/self_manager.rb +2 -3
  106. data/lib/bundler/settings.rb +1 -0
  107. data/lib/bundler/shared_helpers.rb +2 -2
  108. data/lib/bundler/source/git/git_proxy.rb +0 -6
  109. data/lib/bundler/source/git.rb +56 -31
  110. data/lib/bundler/source/path.rb +2 -2
  111. data/lib/bundler/source_list.rb +1 -1
  112. data/lib/bundler/spec_set.rb +81 -56
  113. data/lib/bundler/stub_specification.rb +8 -0
  114. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  115. data/lib/bundler/uri_credentials_filter.rb +1 -1
  116. data/lib/bundler/vendor/fileutils/COPYING +56 -0
  117. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
  118. data/lib/bundler/vendor/securerandom/COPYING +56 -0
  119. data/lib/bundler/vendor/securerandom/lib/securerandom.rb +5 -5
  120. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
  121. data/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
  122. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
  123. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
  124. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
  125. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
  126. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
  127. data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
  128. data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  129. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  130. data/lib/bundler/vendor/thor/lib/thor.rb +11 -0
  131. data/lib/bundler/vendor/uri/COPYING +56 -0
  132. data/lib/bundler/vendor/uri/lib/uri/common.rb +37 -16
  133. data/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
  134. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
  135. data/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
  136. data/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
  137. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
  138. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
  139. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  140. data/lib/bundler/vendor/uri/lib/uri.rb +9 -9
  141. data/lib/bundler/vendored_securerandom.rb +0 -2
  142. data/lib/bundler/version.rb +1 -1
  143. data/lib/bundler.rb +37 -13
  144. metadata +18 -12
  145. data/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
  146. data/lib/bundler/vendor/securerandom/LICENSE.txt +0 -22
  147. data/lib/bundler/vendor/securerandom/lib/random/formatter.rb +0 -373
  148. data/lib/bundler/vendor/uri/LICENSE.txt +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f964a6e36c3a9919c4326fd76e7646a5b81723f054d36348dca84d40f70272d
4
- data.tar.gz: 6d5cb44abe0e95f451ac4950e044a303bfc1fb44893e1f198f800225b313129f
3
+ metadata.gz: 7e5040339545260efa41ad3b7bd4201dfdc9275e322b970ed3c768a45ec01e06
4
+ data.tar.gz: 6d8271cc5fd5a98f98637ef49a597ff4edc8ce78e2fcb2f504b21c29b6f4b0a1
5
5
  SHA512:
6
- metadata.gz: e541245d67f58bd6f30bce064e02564c475c281b89b0f60083699998e5e2cf4450685f69bfdc02df1fe4900f67cf778dc6a30e1e38db858000dedd72a79384e2
7
- data.tar.gz: 0af9592802c805e17e3bf35eb58d2a10b78ccf25b9fa59cdf637a8c4c8ab7bdad5ecbc1f0c9489eabf4e0b348c937831e7335283703e21209dccbf53b36727e9
6
+ metadata.gz: 1cfdf00dc9e185a6af93c187a55b2c4d2c61f0f21edcfd0b5e213f1b00026e010815c7b1ea4ea2efd96c199b514061b3b183257a4e7aa6b25bd1bce2b6e7404e
7
+ data.tar.gz: b32951d8312bb7d65fabd06c269ca6ec6e2114f9f2836aeb74aa72a73a2b219c56a173f0383f7e917072fe9ab78c7a0fa9c31a58aca24d9faf078490145e9dfa
data/CHANGELOG.md CHANGED
@@ -1,3 +1,62 @@
1
+ # 2.6.0 (December 16, 2024)
2
+
3
+ ## Security:
4
+
5
+ - Fix gemfury credentials written to logs in verbose mode [#8283](https://github.com/rubygems/rubygems/pull/8283)
6
+ - Fix private registry credentials being written to logs [#8222](https://github.com/rubygems/rubygems/pull/8222)
7
+
8
+ ## Breaking changes:
9
+
10
+ - Drop ruby 3.0 support [#8091](https://github.com/rubygems/rubygems/pull/8091)
11
+ - Remove client-side MD5 ETag transition from compact index client [#7677](https://github.com/rubygems/rubygems/pull/7677)
12
+
13
+ ## Deprecations:
14
+
15
+ - Cancel `bundle console` deprecation [#8218](https://github.com/rubygems/rubygems/pull/8218)
16
+ - Warn when platform of installed gem differs from platform in the lockfile [#8029](https://github.com/rubygems/rubygems/pull/8029)
17
+ - Cancel deprecation of Gemfiles without a global source [#8213](https://github.com/rubygems/rubygems/pull/8213)
18
+
19
+ ## Features:
20
+
21
+ - Add a `lockfile_checksums` configuration to include checksums in fresh lockfiles [#8219](https://github.com/rubygems/rubygems/pull/8219)
22
+ - Add `bundle lock --add-checksums` to add checksums to an existing lockfile [#8214](https://github.com/rubygems/rubygems/pull/8214)
23
+
24
+ ## Performance:
25
+
26
+ - Enable a couple of performance cops [#8261](https://github.com/rubygems/rubygems/pull/8261)
27
+ - Remove override of worker jobs for `bundle install --local` [#8248](https://github.com/rubygems/rubygems/pull/8248)
28
+
29
+ ## Enhancements:
30
+
31
+ - Support `bundle exec <relative-path-to-script>` when `Kernel.exec` is used under the hood [#8294](https://github.com/rubygems/rubygems/pull/8294)
32
+ - Improve working with different rubies using the same lockfile [#8251](https://github.com/rubygems/rubygems/pull/8251)
33
+ - Define a few `inspect` methods to help debugging [#8266](https://github.com/rubygems/rubygems/pull/8266)
34
+ - Include original error when openssl fails to load [#8232](https://github.com/rubygems/rubygems/pull/8232)
35
+ - Automatically fix lockfile when it's missing dependencies [#8103](https://github.com/rubygems/rubygems/pull/8103)
36
+ - Fix some JRuby warnings when using `bundler/setup` with Ruby's -w flag [#8205](https://github.com/rubygems/rubygems/pull/8205)
37
+ - Add a `--normalize-platforms` flag to `bundle lock` [#7896](https://github.com/rubygems/rubygems/pull/7896)
38
+ - Add plugin hooks for Bundler.require [#3439](https://github.com/rubygems/rubygems/pull/3439)
39
+
40
+ ## Bug fixes:
41
+
42
+ - Fix restarting with locked version when `$PROGRAM_NAME` has been changed [#8320](https://github.com/rubygems/rubygems/pull/8320)
43
+ - Restore the previous cache format for git sources [#8296](https://github.com/rubygems/rubygems/pull/8296)
44
+ - Fix installs of subdependencies of unlocked dependencies to be conservative [#8281](https://github.com/rubygems/rubygems/pull/8281)
45
+ - Fix test task name on generated readme when using test-unit [#8291](https://github.com/rubygems/rubygems/pull/8291)
46
+ - Fix `bundle exec` executable detection on windows [#8276](https://github.com/rubygems/rubygems/pull/8276)
47
+ - Fix `bundle remove` sometimes not removing gems [#8278](https://github.com/rubygems/rubygems/pull/8278)
48
+ - Fix issue with git gems locking incorrect specs sometimes [#8269](https://github.com/rubygems/rubygems/pull/8269)
49
+
50
+ ## Documentation:
51
+
52
+ - Normalize command flag documentation and make sure all flags are documented [#8313](https://github.com/rubygems/rubygems/pull/8313)
53
+ - Add missing man pages for `bundle env` and `bundle licenses` [#8315](https://github.com/rubygems/rubygems/pull/8315)
54
+ - Add man page for 'bundle issue' command [#8271](https://github.com/rubygems/rubygems/pull/8271)
55
+ - Add man page for 'bundle fund' command [#8258](https://github.com/rubygems/rubygems/pull/8258)
56
+ - Move pry-related contents to `debugging.md` [#8263](https://github.com/rubygems/rubygems/pull/8263)
57
+ - Add debugging instruction on Windows [#8236](https://github.com/rubygems/rubygems/pull/8236)
58
+ - Unify rubygems and bundler docs directory [#8159](https://github.com/rubygems/rubygems/pull/8159)
59
+
1
60
  # 2.5.23 (November 5, 2024)
2
61
 
3
62
  ## Enhancements:
data/bundler.gemspec CHANGED
@@ -29,10 +29,10 @@ Gem::Specification.new do |s|
29
29
  "source_code_uri" => "https://github.com/rubygems/rubygems/tree/master/bundler",
30
30
  }
31
31
 
32
- s.required_ruby_version = ">= 3.0.0"
32
+ s.required_ruby_version = ">= 3.1.0"
33
33
 
34
34
  # It should match the RubyGems version shipped with `required_ruby_version` above
35
- s.required_rubygems_version = ">= 3.2.3"
35
+ s.required_rubygems_version = ">= 3.3.3"
36
36
 
37
37
  s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
38
38
 
@@ -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 = "2024-11-05".freeze
8
- @git_commit_sha = "35f4611265e".freeze
7
+ @built_at = "2024-12-16".freeze
8
+ @git_commit_sha = "d6be0319aaf".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -9,10 +9,6 @@ module Bundler
9
9
  end
10
10
 
11
11
  def run
12
- message = "bundle console will be replaced by `bin/console` generated by `bundle gem <name>`"
13
- removed_message = "bundle console has been replaced by `bin/console` generated by `bundle gem <name>`"
14
- Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
15
-
16
12
  group ? Bundler.require(:default, *group.split(" ").map!(&:to_sym)) : Bundler.require
17
13
  ARGV.clear
18
14
 
@@ -32,11 +32,11 @@ module Bundler
32
32
 
33
33
  def dylibs_ldd(path)
34
34
  output = `/usr/bin/ldd #{path.shellescape}`.chomp
35
- output.split("\n").map do |l|
35
+ output.split("\n").filter_map do |l|
36
36
  match = l.match(LDD_REGEX)
37
37
  next if match.nil?
38
38
  match.captures[0]
39
- end.compact
39
+ end
40
40
  end
41
41
 
42
42
  def dylibs(path)
@@ -89,11 +89,11 @@ module Bundler
89
89
 
90
90
  if broken_links.any?
91
91
  message = "The following gems are missing OS dependencies:"
92
- broken_links.map do |spec, paths|
92
+ broken_links.flat_map do |spec, paths|
93
93
  paths.uniq.map do |path|
94
94
  "\n * #{spec.name}: #{path}"
95
95
  end
96
- end.flatten.sort.each {|m| message += m }
96
+ end.sort.each {|m| message += m }
97
97
  raise ProductionError, message
98
98
  elsif !permissions_valid
99
99
  Bundler.ui.info "No issues found with the installed bundle"
@@ -22,6 +22,7 @@ module Bundler
22
22
  if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
23
23
  return kernel_load(bin_path, *args)
24
24
  end
25
+ bin_path = "./" + bin_path unless File.absolute_path?(bin_path)
25
26
  kernel_exec(bin_path, *args)
26
27
  else
27
28
  # exec using the given command
@@ -446,7 +446,7 @@ module Bundler
446
446
  end
447
447
 
448
448
  def required_ruby_version
449
- "3.0.0"
449
+ "3.1.0"
450
450
  end
451
451
 
452
452
  def rubocop_version
@@ -73,11 +73,11 @@ module Bundler
73
73
  end
74
74
 
75
75
  def gem_dependencies
76
- @gem_dependencies ||= Bundler.definition.specs.map do |spec|
76
+ @gem_dependencies ||= Bundler.definition.specs.filter_map do |spec|
77
77
  dependency = spec.dependencies.find {|dep| dep.name == gem_name }
78
78
  next unless dependency
79
79
  "#{spec.name} (#{spec.version}) depends on #{gem_name} (#{dependency.requirements_list.join(", ")})"
80
- end.compact.sort
80
+ end.sort
81
81
  end
82
82
  end
83
83
  end
@@ -48,7 +48,7 @@ module Bundler
48
48
 
49
49
  def last_version_number
50
50
  definition = Bundler.definition(true)
51
- definition.resolve_remotely!
51
+ definition.remotely!
52
52
  specs = definition.index[name].sort_by(&:version)
53
53
  unless options[:pre]
54
54
  specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
@@ -23,6 +23,10 @@ module Bundler
23
23
  # Disable color in deployment mode
24
24
  Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
25
25
 
26
+ if target_rbconfig_path = options[:"target-rbconfig"]
27
+ Bundler.rubygems.set_target_rbconfig(target_rbconfig_path)
28
+ end
29
+
26
30
  check_for_options_conflicts
27
31
 
28
32
  check_trust_policy
@@ -14,6 +14,8 @@ module Bundler
14
14
  exit 1
15
15
  end
16
16
 
17
+ check_for_conflicting_options
18
+
17
19
  print = options[:print]
18
20
  previous_output_stream = Bundler.ui.output_stream
19
21
  Bundler.ui.output_stream = :stderr if print
@@ -38,6 +40,7 @@ module Bundler
38
40
 
39
41
  Bundler.settings.temporary(frozen: false) do
40
42
  definition = Bundler.definition(update, file)
43
+ definition.add_checksums if options["add-checksums"]
41
44
 
42
45
  Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
43
46
 
@@ -58,7 +61,11 @@ module Bundler
58
61
  raise InvalidOption, "Removing all platforms from the bundle is not allowed"
59
62
  end
60
63
 
61
- definition.resolve_remotely! unless options[:local]
64
+ definition.remotely! unless options[:local]
65
+
66
+ if options["normalize-platforms"]
67
+ definition.normalize_platforms
68
+ end
62
69
 
63
70
  if print
64
71
  puts definition.to_lock
@@ -70,5 +77,17 @@ module Bundler
70
77
 
71
78
  Bundler.ui.output_stream = previous_output_stream
72
79
  end
80
+
81
+ private
82
+
83
+ def check_for_conflicting_options
84
+ if options["normalize-platforms"] && options["add-platform"].any?
85
+ raise InvalidOption, "--normalize-platforms can't be used with --add-platform"
86
+ end
87
+
88
+ if options["normalize-platforms"] && options["remove-platform"].any?
89
+ raise InvalidOption, "--normalize-platforms can't be used with --remove-platform"
90
+ end
91
+ end
73
92
  end
74
93
  end
@@ -49,7 +49,7 @@ module Bundler
49
49
  true
50
50
  end.map(&:name)
51
51
 
52
- jobs = installer.send(:installation_parallelization, {})
52
+ jobs = installer.send(:installation_parallelization)
53
53
  pristine_count = definition.specs.count - installed_specs.count
54
54
  # allow a pristining a single gem to skip the parallel worker
55
55
  jobs = [jobs, pristine_count].min
@@ -59,9 +59,9 @@ module Bundler
59
59
  definition = Bundler.definition(true)
60
60
  if options[:outdated]
61
61
  Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
62
- Bundler.ui.silence { definition.resolve_remotely! }
62
+ Bundler.ui.silence { definition.remotely! }
63
63
  else
64
- definition.resolve_with_cache!
64
+ definition.with_cache!
65
65
  end
66
66
  Bundler.reset!
67
67
  definition.specs
data/lib/bundler/cli.rb CHANGED
@@ -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"
@@ -398,9 +396,7 @@ module Bundler
398
396
  end
399
397
 
400
398
  desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
401
- method_option "all", type: :boolean,
402
- default: Bundler.feature_flag.cache_all?,
403
- 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)."
404
400
  method_option "all-platforms", type: :boolean, banner: "Include gems for all platforms present in the lockfile, not only the current one"
405
401
  method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
406
402
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
@@ -438,8 +434,8 @@ module Bundler
438
434
  map aliases_for("cache")
439
435
 
440
436
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
441
- method_option :keep_file_descriptors, type: :boolean, default: true
442
- 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"
443
439
  long_desc <<-D
444
440
  Exec runs a command, providing it access to the gems in the bundle. While using
445
441
  bundle exec you can require and call the bundled gems as if they were installed
@@ -480,12 +476,10 @@ module Bundler
480
476
  Open.new(options, name).run
481
477
  end
482
478
 
483
- unless Bundler.feature_flag.bundler_3_mode?
484
- desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
485
- def console(group = nil)
486
- require_relative "cli/console"
487
- Console.new(options, group).run
488
- 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
489
483
  end
490
484
 
491
485
  desc "version", "Prints Bundler version information"
@@ -537,55 +531,28 @@ module Bundler
537
531
  end
538
532
  end
539
533
 
540
- old_gem = instance_method(:gem)
541
-
542
534
  desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
543
535
  method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], desc: "Generate a binary executable for your library."
544
536
  method_option :coc, type: :boolean, desc: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
545
- method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR",
546
- lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
547
- 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)"
548
538
  method_option :ext, type: :string, desc: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
549
539
  method_option :git, type: :boolean, default: true, desc: "Initialize a git repo inside your library."
550
540
  method_option :mit, type: :boolean, desc: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
551
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`."
552
542
  method_option :changelog, type: :boolean, desc: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
553
- method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library",
554
- enum: %w[rspec minitest test-unit],
555
- 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)`."
556
- method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "",
557
- enum: %w[github gitlab circle],
558
- desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
559
- method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "",
560
- enum: %w[rubocop standard],
561
- 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)`"
562
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>`."
563
547
 
564
548
  def gem(name)
565
- end
566
-
567
- commands["gem"].tap do |gem_command|
568
- def gem_command.run(instance, args = [])
569
- arity = 1 # name
549
+ require_relative "cli/gem"
550
+ cmd_args = args + [self]
551
+ cmd_args.unshift(options)
570
552
 
571
- require_relative "cli/gem"
572
- cmd_args = args + [instance]
573
- cmd_args.unshift(instance.options)
574
-
575
- cmd = begin
576
- Gem.new(*cmd_args)
577
- rescue ArgumentError => e
578
- instance.class.handle_argument_error(self, e, args, arity)
579
- end
580
-
581
- cmd.run
582
- end
553
+ Gem.new(*cmd_args).run
583
554
  end
584
555
 
585
- undef_method(:gem)
586
- define_method(:gem, old_gem)
587
- private :gem
588
-
589
556
  def self.source_root
590
557
  File.expand_path("templates", __dir__)
591
558
  end
@@ -621,8 +588,10 @@ module Bundler
621
588
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
622
589
  method_option "lockfile", type: :string, default: nil, banner: "the path the lockfile should be written to"
623
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"
624
592
  method_option "add-platform", type: :array, default: [], banner: "Add a new platform to the lockfile"
625
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"
626
595
  method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
627
596
  method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
628
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/")