rubygems-update 3.6.9 → 3.7.1

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 (145) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +873 -790
  3. data/CODE_OF_CONDUCT.md +1 -1
  4. data/CONTRIBUTING.md +9 -0
  5. data/Manifest.txt +4 -21
  6. data/README.md +1 -1
  7. data/SECURITY.md +7 -0
  8. data/bundler/CHANGELOG.md +1110 -1033
  9. data/bundler/README.md +7 -7
  10. data/bundler/bundler.gemspec +2 -2
  11. data/bundler/lib/bundler/build_metadata.rb +10 -11
  12. data/bundler/lib/bundler/cli/common.rb +1 -1
  13. data/bundler/lib/bundler/cli/config.rb +2 -2
  14. data/bundler/lib/bundler/cli/gem.rb +62 -30
  15. data/bundler/lib/bundler/cli/install.rb +5 -5
  16. data/bundler/lib/bundler/cli/outdated.rb +1 -1
  17. data/bundler/lib/bundler/cli/update.rb +3 -3
  18. data/bundler/lib/bundler/cli.rb +24 -38
  19. data/bundler/lib/bundler/compact_index_client.rb +1 -5
  20. data/bundler/lib/bundler/current_ruby.rb +27 -3
  21. data/bundler/lib/bundler/definition.rb +21 -22
  22. data/bundler/lib/bundler/dependency.rb +1 -1
  23. data/bundler/lib/bundler/dsl.rb +33 -23
  24. data/bundler/lib/bundler/feature_flag.rb +15 -12
  25. data/bundler/lib/bundler/fetcher/dependency.rb +2 -1
  26. data/bundler/lib/bundler/fetcher/downloader.rb +33 -7
  27. data/bundler/lib/bundler/fetcher.rb +49 -19
  28. data/bundler/lib/bundler/friendly_errors.rb +2 -1
  29. data/bundler/lib/bundler/index.rb +7 -2
  30. data/bundler/lib/bundler/installer.rb +5 -4
  31. data/bundler/lib/bundler/lazy_specification.rb +9 -7
  32. data/bundler/lib/bundler/lockfile_parser.rb +21 -5
  33. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-config.1 +172 -126
  39. data/bundler/lib/bundler/man/bundle-config.1.ronn +91 -91
  40. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-doctor.1 +43 -4
  42. data/bundler/lib/bundler/man/bundle-doctor.1.ronn +48 -4
  43. data/bundler/lib/bundler/man/bundle-env.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-fund.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-gem.1 +67 -44
  47. data/bundler/lib/bundler/man/bundle-gem.1.ronn +8 -4
  48. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  49. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  50. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle-inject.1 +2 -2
  52. data/bundler/lib/bundler/man/bundle-inject.1.ronn +1 -1
  53. data/bundler/lib/bundler/man/bundle-install.1 +4 -4
  54. data/bundler/lib/bundler/man/bundle-install.1.ronn +3 -4
  55. data/bundler/lib/bundler/man/bundle-issue.1 +1 -1
  56. data/bundler/lib/bundler/man/bundle-licenses.1 +1 -1
  57. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  58. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  59. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  60. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  61. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  62. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  63. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  64. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  65. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  66. data/bundler/lib/bundler/man/bundle-update.1 +5 -5
  67. data/bundler/lib/bundler/man/bundle-update.1.ronn +4 -4
  68. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  69. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  70. data/bundler/lib/bundler/man/bundle.1 +1 -1
  71. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  72. data/bundler/lib/bundler/match_platform.rb +31 -12
  73. data/bundler/lib/bundler/materialization.rb +2 -2
  74. data/bundler/lib/bundler/resolver/package.rb +1 -1
  75. data/bundler/lib/bundler/resolver.rb +1 -3
  76. data/bundler/lib/bundler/rubygems_ext.rb +116 -120
  77. data/bundler/lib/bundler/rubygems_integration.rb +11 -6
  78. data/bundler/lib/bundler/runtime.rb +1 -1
  79. data/bundler/lib/bundler/self_manager.rb +32 -42
  80. data/bundler/lib/bundler/settings/validator.rb +0 -23
  81. data/bundler/lib/bundler/settings.rb +4 -6
  82. data/bundler/lib/bundler/shared_helpers.rb +6 -4
  83. data/bundler/lib/bundler/source/git/git_proxy.rb +3 -3
  84. data/bundler/lib/bundler/source/path.rb +7 -0
  85. data/bundler/lib/bundler/source_list.rb +1 -5
  86. data/bundler/lib/bundler/source_map.rb +1 -1
  87. data/bundler/lib/bundler/spec_set.rb +7 -3
  88. data/bundler/lib/bundler/templates/Executable +0 -11
  89. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -0
  90. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -5
  91. data/bundler/lib/bundler/ui/shell.rb +2 -2
  92. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  93. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
  94. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +81 -42
  95. data/bundler/lib/bundler/version.rb +10 -2
  96. data/bundler/lib/bundler/worker.rb +1 -1
  97. data/bundler/lib/bundler.rb +14 -12
  98. data/doc/bundler/UPGRADING.md +132 -127
  99. data/doc/rubygems/CONTRIBUTING.md +1 -1
  100. data/lib/rubygems/basic_specification.rb +7 -0
  101. data/lib/rubygems/commands/pristine_command.rb +9 -12
  102. data/lib/rubygems/commands/setup_command.rb +2 -2
  103. data/lib/rubygems/core_ext/kernel_require.rb +5 -2
  104. data/lib/rubygems/ext/cargo_builder.rb +4 -0
  105. data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +10 -3
  106. data/lib/rubygems/gemcutter_utilities.rb +1 -1
  107. data/lib/rubygems/installer.rb +45 -50
  108. data/lib/rubygems/platform.rb +142 -39
  109. data/lib/rubygems/remote_fetcher.rb +3 -3
  110. data/lib/rubygems/request_set.rb +3 -6
  111. data/lib/rubygems/resolver/best_set.rb +1 -1
  112. data/lib/rubygems/resolver/source_set.rb +1 -1
  113. data/lib/rubygems/resolver.rb +1 -1
  114. data/lib/rubygems/s3_uri_signer.rb +5 -3
  115. data/lib/rubygems/source.rb +28 -22
  116. data/lib/rubygems/specification.rb +2 -2
  117. data/lib/rubygems/uri_formatter.rb +2 -1
  118. data/lib/rubygems/util/licenses.rb +21 -0
  119. data/lib/rubygems/vendor/net-http/lib/net/http.rb +14 -19
  120. data/lib/rubygems/vendor/resolv/lib/resolv.rb +50 -22
  121. data/lib/rubygems.rb +72 -7
  122. data/rubygems-update.gemspec +2 -2
  123. data/setup.rb +1 -1
  124. metadata +7 -24
  125. data/bundler/lib/bundler/gem_helpers.rb +0 -144
  126. data/bundler/lib/bundler/templates/Executable.bundler +0 -109
  127. data/bundler/lib/bundler/vendor/fileutils/.document +0 -1
  128. data/bundler/lib/bundler/vendor/net-http-persistent/.document +0 -1
  129. data/bundler/lib/bundler/vendor/pub_grub/.document +0 -1
  130. data/bundler/lib/bundler/vendor/securerandom/.document +0 -1
  131. data/bundler/lib/bundler/vendor/thor/.document +0 -1
  132. data/bundler/lib/bundler/vendor/tsort/.document +0 -1
  133. data/bundler/lib/bundler/vendor/uri/.document +0 -1
  134. data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +0 -21
  135. data/lib/rubygems/vendor/molinillo/.document +0 -1
  136. data/lib/rubygems/vendor/net-http/.document +0 -1
  137. data/lib/rubygems/vendor/net-protocol/.document +0 -1
  138. data/lib/rubygems/vendor/optparse/.document +0 -1
  139. data/lib/rubygems/vendor/resolv/.document +0 -1
  140. data/lib/rubygems/vendor/securerandom/.document +0 -1
  141. data/lib/rubygems/vendor/timeout/.document +0 -1
  142. data/lib/rubygems/vendor/tsort/.document +0 -1
  143. data/lib/rubygems/vendor/uri/.document +0 -1
  144. /data/lib/rubygems/ssl_certs/rubygems.org/{GlobalSignRootCA_R3.pem → GlobalSign.pem} +0 -0
  145. /data/{bundler/lib/bundler/vendor/connection_pool → lib/rubygems/vendor}/.document +0 -0
data/bundler/README.md CHANGED
@@ -6,7 +6,7 @@ Bundler makes sure Ruby applications run the same code on every machine.
6
6
 
7
7
  It does this by managing the gems that the application depends on. Given a list of gems, it can automatically download and install those gems, as well as any other gems needed by the gems that are listed. Before installing gems, it checks the versions of every gem to make sure that they are compatible, and can all be loaded at the same time. After the gems have been installed, Bundler can help you update some or all of them when new versions become available. Finally, it records the exact versions that have been installed, so that others can install the exact same gems.
8
8
 
9
- ### Installation and usage
9
+ ## Installation and usage
10
10
 
11
11
  To install (or update to the latest version):
12
12
 
@@ -27,32 +27,32 @@ bundle exec rspec
27
27
 
28
28
  See [bundler.io](https://bundler.io) for the full documentation.
29
29
 
30
- ### Troubleshooting
30
+ ## Troubleshooting
31
31
 
32
32
  For help with common problems, see [TROUBLESHOOTING](../doc/bundler/TROUBLESHOOTING.md).
33
33
 
34
34
  Still stuck? Try [filing an issue](https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md).
35
35
 
36
- ### Other questions
36
+ ## Other questions
37
37
 
38
38
  To see what has changed in recent versions of Bundler, see the [CHANGELOG](CHANGELOG.md).
39
39
 
40
40
  To get in touch with the Bundler core team and other Bundler users, please join [the Bundler slack](https://join.slack.com/t/bundler/shared_invite/zt-1rrsuuv3m-OmXKWQf8K6iSla4~F1DBjQ).
41
41
 
42
- ### Contributing
42
+ ## Contributing
43
43
 
44
44
  If you'd like to contribute to Bundler, that's awesome, and we <3 you. We've put together [the Bundler contributor guide](https://github.com/rubygems/rubygems/blob/master/doc/bundler/contributing/README.md) with all of the information you need to get started.
45
45
 
46
46
  If you'd like to request a substantial change to Bundler or its documentation, refer to the [Bundler RFC process](https://github.com/rubygems/rfcs) for more information.
47
47
 
48
- ### Supporting
48
+ ## Supporting
49
49
 
50
50
  RubyGems is managed by [Ruby Central](https://rubycentral.org), a non-profit organization that supports the Ruby community through projects like this one, as well as [RubyConf](https://rubyconf.org), [RailsConf](https://railsconf.org), and [RubyGems.org](https://rubygems.org). You can support Ruby Central by attending or [sponsoring](sponsors@rubycentral.org) a conference, or by [joining as a supporting member](https://rubycentral.org/#/portal/signup).
51
51
 
52
- ### Code of Conduct
52
+ ## Code of Conduct
53
53
 
54
54
  Everyone interacting in the Bundler project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [Bundler code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
55
55
 
56
- ### License
56
+ ## License
57
57
 
58
58
  Bundler is available under an [MIT License](https://github.com/rubygems/rubygems/blob/master/bundler/LICENSE.md).
@@ -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.1.0"
32
+ s.required_ruby_version = ">= 3.2.0"
33
33
 
34
34
  # It should match the RubyGems version shipped with `required_ruby_version` above
35
- s.required_rubygems_version = ">= 3.3.3"
35
+ s.required_rubygems_version = ">= 3.4.1"
36
36
 
37
37
  s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
38
38
 
@@ -4,23 +4,27 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "1980-01-02".freeze
8
- @git_commit_sha = "8a2a14d63da".freeze
9
- @release = true
7
+ @built_at = "2025-07-21".freeze
8
+ @git_commit_sha = "bd22001d8c7".freeze
10
9
  # end ivars
11
10
 
12
11
  # A hash representation of the build metadata.
13
12
  def self.to_h
14
13
  {
15
- "Built At" => built_at,
14
+ "Timestamp" => timestamp,
16
15
  "Git SHA" => git_commit_sha,
17
- "Released Version" => release?,
18
16
  }
19
17
  end
20
18
 
19
+ # A timestamp representing the date the bundler gem was built, or the
20
+ # current time if never built
21
+ def self.timestamp
22
+ @timestamp ||= @built_at || Time.now.utc.strftime("%Y-%m-%d").freeze
23
+ end
24
+
21
25
  # A string representing the date the bundler gem was built.
22
26
  def self.built_at
23
- @built_at ||= Time.now.utc.strftime("%Y-%m-%d").freeze
27
+ @built_at
24
28
  end
25
29
 
26
30
  # The SHA for the git commit the bundler gem was built from.
@@ -36,10 +40,5 @@ module Bundler
36
40
 
37
41
  @git_commit_sha ||= "unknown"
38
42
  end
39
-
40
- # Whether this is an official release build of Bundler.
41
- def self.release?
42
- @release
43
- end
44
43
  end
45
44
  end
@@ -130,7 +130,7 @@ module Bundler
130
130
  def self.clean_after_install?
131
131
  clean = Bundler.settings[:clean]
132
132
  return clean unless clean.nil?
133
- clean ||= Bundler.feature_flag.auto_clean_without_path? && Bundler.settings[:path].nil?
133
+ clean ||= Bundler.feature_flag.bundler_4_mode? && Bundler.settings[:path].nil?
134
134
  clean &&= !Bundler.use_system_gems?
135
135
  clean
136
136
  end
@@ -26,8 +26,8 @@ module Bundler
26
26
  end
27
27
 
28
28
  message = "Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."
29
- removed_message = "Using the `config` command without a subcommand [list, get, set, unset] is has been removed. Use `bundle #{new_args.join(" ")}` instead."
30
- SharedHelpers.major_deprecation 3, message, removed_message: removed_message
29
+ removed_message = "Using the `config` command without a subcommand [list, get, set, unset] has been removed. Use `bundle #{new_args.join(" ")}` instead."
30
+ SharedHelpers.major_deprecation 4, message, removed_message: removed_message
31
31
 
32
32
  Base.new(options, name, value, self).run
33
33
  end
@@ -31,7 +31,6 @@ module Bundler
31
31
  @extension = options[:ext]
32
32
 
33
33
  validate_ext_name if @extension
34
- validate_rust_builder_rubygems_version if @extension == "rust"
35
34
  end
36
35
 
37
36
  def run
@@ -48,13 +47,16 @@ module Bundler
48
47
  git_author_name = use_git ? `git config user.name`.chomp : ""
49
48
  git_username = use_git ? `git config github.user`.chomp : ""
50
49
  git_user_email = use_git ? `git config user.email`.chomp : ""
50
+ github_username = github_username(git_username)
51
51
 
52
- github_username = if options[:github_username].nil?
53
- git_username
54
- elsif options[:github_username] == false
55
- ""
52
+ if github_username.empty?
53
+ homepage_uri = "TODO: Put your gem's website or public repo URL here."
54
+ source_code_uri = "TODO: Put your gem's public repo URL here."
55
+ changelog_uri = "TODO: Put your gem's CHANGELOG.md URL here."
56
56
  else
57
- options[:github_username]
57
+ homepage_uri = "https://github.com/#{github_username}/#{name}"
58
+ source_code_uri = "https://github.com/#{github_username}/#{name}"
59
+ changelog_uri = "https://github.com/#{github_username}/#{name}/blob/main/CHANGELOG.md"
58
60
  end
59
61
 
60
62
  config = {
@@ -69,12 +71,17 @@ module Bundler
69
71
  test: options[:test],
70
72
  ext: extension,
71
73
  exe: options[:exe],
74
+ bundle: options[:bundle],
72
75
  bundler_version: bundler_dependency_version,
73
76
  git: use_git,
74
77
  github_username: github_username.empty? ? "[USERNAME]" : github_username,
75
78
  required_ruby_version: required_ruby_version,
76
79
  rust_builder_required_rubygems_version: rust_builder_required_rubygems_version,
77
80
  minitest_constant_name: minitest_constant_name,
81
+ ignore_paths: %w[bin/],
82
+ homepage_uri: homepage_uri,
83
+ source_code_uri: source_code_uri,
84
+ changelog_uri: changelog_uri,
78
85
  }
79
86
  ensure_safe_gem_name(name, constant_array)
80
87
 
@@ -95,7 +102,18 @@ module Bundler
95
102
  bin/setup
96
103
  ]
97
104
 
98
- templates.merge!("gitignore.tt" => ".gitignore") if use_git
105
+ case Bundler.preferred_gemfile_name
106
+ when "Gemfile"
107
+ config[:ignore_paths] << "Gemfile"
108
+ when "gems.rb"
109
+ config[:ignore_paths] << "gems.rb"
110
+ config[:ignore_paths] << "gems.locked"
111
+ end
112
+
113
+ if use_git
114
+ templates.merge!("gitignore.tt" => ".gitignore")
115
+ config[:ignore_paths] << ".gitignore"
116
+ end
99
117
 
100
118
  if test_framework = ask_and_set_test_framework
101
119
  config[:test] = test_framework
@@ -109,6 +127,8 @@ module Bundler
109
127
  "spec/newgem_spec.rb.tt" => "spec/#{namespaced_path}_spec.rb"
110
128
  )
111
129
  config[:test_task] = :spec
130
+ config[:ignore_paths] << ".rspec"
131
+ config[:ignore_paths] << "spec/"
112
132
  when "minitest"
113
133
  # Generate path for minitest target file (FileList["test/**/test_*.rb"])
114
134
  # foo => test/test_foo.rb
@@ -123,12 +143,14 @@ module Bundler
123
143
  "test/minitest/test_newgem.rb.tt" => "test/#{minitest_namespaced_path}.rb"
124
144
  )
125
145
  config[:test_task] = :test
146
+ config[:ignore_paths] << "test/"
126
147
  when "test-unit"
127
148
  templates.merge!(
128
149
  "test/test-unit/test_helper.rb.tt" => "test/test_helper.rb",
129
150
  "test/test-unit/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
130
151
  )
131
152
  config[:test_task] = :test
153
+ config[:ignore_paths] << "test/"
132
154
  end
133
155
  end
134
156
 
@@ -136,19 +158,19 @@ module Bundler
136
158
  case config[:ci]
137
159
  when "github"
138
160
  templates.merge!("github/workflows/main.yml.tt" => ".github/workflows/main.yml")
139
- config[:ci_config_path] = ".github "
161
+ config[:ignore_paths] << ".github/"
140
162
  when "gitlab"
141
163
  templates.merge!("gitlab-ci.yml.tt" => ".gitlab-ci.yml")
142
- config[:ci_config_path] = ".gitlab-ci.yml "
164
+ config[:ignore_paths] << ".gitlab-ci.yml"
143
165
  when "circle"
144
166
  templates.merge!("circleci/config.yml.tt" => ".circleci/config.yml")
145
- config[:ci_config_path] = ".circleci "
167
+ config[:ignore_paths] << ".circleci/"
146
168
  end
147
169
 
148
170
  if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
149
- "This means that any other developer or company will be legally allowed to use your code " \
150
- "for free as long as they admit you created it. You can read more about the MIT license " \
151
- "at https://choosealicense.com/licenses/mit.")
171
+ "Using a MIT license means that any other developer or company will be legally allowed " \
172
+ "to use your code for free as long as they admit you created it. You can read more about " \
173
+ "the MIT license at https://choosealicense.com/licenses/mit.")
152
174
  config[:mit] = true
153
175
  Bundler.ui.info "MIT License enabled in config"
154
176
  templates.merge!("LICENSE.txt.tt" => "LICENSE.txt")
@@ -185,10 +207,12 @@ module Bundler
185
207
  config[:linter_version] = rubocop_version
186
208
  Bundler.ui.info "RuboCop enabled in config"
187
209
  templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
210
+ config[:ignore_paths] << ".rubocop.yml"
188
211
  when "standard"
189
212
  config[:linter_version] = standard_version
190
213
  Bundler.ui.info "Standard enabled in config"
191
214
  templates.merge!("standard.yml.tt" => ".standard.yml")
215
+ config[:ignore_paths] << ".standard.yml"
192
216
  end
193
217
 
194
218
  if config[:exe]
@@ -219,7 +243,7 @@ module Bundler
219
243
  end
220
244
 
221
245
  if use_git
222
- Bundler.ui.info "Initializing git repo in #{target}"
246
+ Bundler.ui.info "\nInitializing git repo in #{target}"
223
247
  require "shellwords"
224
248
  `git init #{target.to_s.shellescape}`
225
249
 
@@ -241,10 +265,17 @@ module Bundler
241
265
  IO.popen(%w[git add .], { chdir: target }, &:read)
242
266
  end
243
267
 
268
+ if config[:bundle]
269
+ Bundler.ui.info "Running bundle install in the new gem directory."
270
+ Dir.chdir(target) do
271
+ system("bundle install")
272
+ end
273
+ end
274
+
244
275
  # Open gemspec in editor
245
276
  open_editor(options["edit"], target.join("#{name}.gemspec")) if options[:edit]
246
277
 
247
- Bundler.ui.info "Gem '#{name}' was successfully created. " \
278
+ Bundler.ui.info "\nGem '#{name}' was successfully created. " \
248
279
  "For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html"
249
280
  end
250
281
 
@@ -254,13 +285,13 @@ module Bundler
254
285
  SharedHelpers.pwd.join(name).basename.to_s
255
286
  end
256
287
 
257
- def ask_and_set(key, header, message)
288
+ def ask_and_set(key, prompt, explanation)
258
289
  choice = options[key]
259
290
  choice = Bundler.settings["gem.#{key}"] if choice.nil?
260
291
 
261
292
  if choice.nil?
262
- Bundler.ui.confirm header
263
- choice = Bundler.ui.yes? "#{message} y/(n):"
293
+ Bundler.ui.info "\n#{explanation}"
294
+ choice = Bundler.ui.yes? "#{prompt} y/(n):"
264
295
  Bundler.settings.set_global("gem.#{key}", choice)
265
296
  end
266
297
 
@@ -282,7 +313,7 @@ module Bundler
282
313
  test_framework = options[:test] || Bundler.settings["gem.test"]
283
314
 
284
315
  if test_framework.to_s.empty?
285
- Bundler.ui.confirm "Do you want to generate tests with your gem?"
316
+ Bundler.ui.info "\nDo you want to generate tests with your gem?"
286
317
  Bundler.ui.info hint_text("test")
287
318
 
288
319
  result = Bundler.ui.ask "Enter a test framework. rspec/minitest/test-unit/(none):"
@@ -322,12 +353,11 @@ module Bundler
322
353
  ci_template = options[:ci] || Bundler.settings["gem.ci"]
323
354
 
324
355
  if ci_template.to_s.empty?
325
- Bundler.ui.confirm "Do you want to set up continuous integration for your gem? " \
356
+ Bundler.ui.info "\nDo you want to set up continuous integration for your gem? " \
326
357
  "Supported services:\n" \
327
358
  "* CircleCI: https://circleci.com/\n" \
328
359
  "* GitHub Actions: https://github.com/features/actions\n" \
329
- "* GitLab CI: https://docs.gitlab.com/ee/ci/\n" \
330
- "\n"
360
+ "* GitLab CI: https://docs.gitlab.com/ee/ci/\n"
331
361
  Bundler.ui.info hint_text("ci")
332
362
 
333
363
  result = Bundler.ui.ask "Enter a CI service. github/gitlab/circle/(none):"
@@ -355,11 +385,10 @@ module Bundler
355
385
  linter_template = deprecated_rubocop_option if linter_template.nil?
356
386
 
357
387
  if linter_template.to_s.empty?
358
- Bundler.ui.confirm "Do you want to add a code linter and formatter to your gem? " \
388
+ Bundler.ui.info "\nDo you want to add a code linter and formatter to your gem? " \
359
389
  "Supported Linters:\n" \
360
390
  "* RuboCop: https://rubocop.org\n" \
361
- "* Standard: https://github.com/standardrb/standard\n" \
362
- "\n"
391
+ "* Standard: https://github.com/standardrb/standard\n"
363
392
  Bundler.ui.info hint_text("linter")
364
393
 
365
394
  result = Bundler.ui.ask "Enter a linter. rubocop/standard/(none):"
@@ -446,7 +475,7 @@ module Bundler
446
475
  end
447
476
 
448
477
  def required_ruby_version
449
- "3.1.0"
478
+ "3.2.0"
450
479
  end
451
480
 
452
481
  def rubocop_version
@@ -457,10 +486,13 @@ module Bundler
457
486
  "1.3"
458
487
  end
459
488
 
460
- def validate_rust_builder_rubygems_version
461
- if Gem::Version.new(rust_builder_required_rubygems_version) > Gem.rubygems_version
462
- Bundler.ui.error "Your RubyGems version (#{Gem.rubygems_version}) is too old to build Rust extension. Please update your RubyGems using `gem update --system` or any other way and try again."
463
- exit 1
489
+ def github_username(git_username)
490
+ if options[:github_username].nil?
491
+ git_username
492
+ elsif options[:github_username] == false
493
+ ""
494
+ else
495
+ options[:github_username]
464
496
  end
465
497
  end
466
498
  end
@@ -66,7 +66,9 @@ module Bundler
66
66
 
67
67
  Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
68
68
 
69
- definition = Bundler.definition
69
+ # For install we want to enable strict validation
70
+ # (rather than some optimizations we perform at app runtime).
71
+ definition = Bundler.definition(strict: true)
70
72
  definition.validate_runtime!
71
73
 
72
74
  installer = Installer.install(Bundler.root, definition, options)
@@ -158,9 +160,7 @@ module Bundler
158
160
  Bundler.settings.set_command_option_if_given :path, options[:path]
159
161
 
160
162
  if options["standalone"] && Bundler.settings[:path].nil? && !options["local"]
161
- Bundler.settings.temporary(path_relative_to_cwd: false) do
162
- Bundler.settings.set_command_option :path, "bundle"
163
- end
163
+ Bundler.settings.set_command_option :path, "bundle"
164
164
  end
165
165
 
166
166
  bin_option = options["binstubs"]
@@ -179,7 +179,7 @@ module Bundler
179
179
 
180
180
  normalize_groups if options[:without] || options[:with]
181
181
 
182
- options[:force] = options[:redownload]
182
+ options[:force] = options[:redownload] if options[:redownload]
183
183
  end
184
184
 
185
185
  def warn_ambiguous_gems
@@ -155,7 +155,7 @@ module Bundler
155
155
 
156
156
  return active_spec if strict
157
157
 
158
- active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
158
+ active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.installable_on_platform?(current_spec.platform) }.sort_by(&:version)
159
159
  if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
160
160
  active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
161
161
  end
@@ -26,7 +26,7 @@ module Bundler
26
26
  if Bundler.feature_flag.update_requires_all_flag?
27
27
  raise InvalidOption, "To update everything, pass the `--all` flag."
28
28
  end
29
- SharedHelpers.major_deprecation 3, "Pass --all to `bundle update` to update everything"
29
+ SharedHelpers.major_deprecation 4, "Pass --all to `bundle update` to update everything"
30
30
  elsif !full_update && options[:all]
31
31
  raise InvalidOption, "Cannot specify --all along with specific options."
32
32
  end
@@ -63,7 +63,7 @@ module Bundler
63
63
  opts = options.dup
64
64
  opts["update"] = true
65
65
  opts["local"] = options[:local]
66
- opts["force"] = options[:redownload]
66
+ opts["force"] = options[:redownload] if options[:redownload]
67
67
 
68
68
  Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]
69
69
 
@@ -92,7 +92,7 @@ module Bundler
92
92
  locked_spec = locked_info[:spec]
93
93
  new_spec = Bundler.definition.specs[name].first
94
94
  unless new_spec
95
- unless locked_spec.match_platform(Bundler.local_platform)
95
+ unless locked_spec.installable_on_platform?(Bundler.local_platform)
96
96
  Bundler.ui.warn "Bundler attempted to update #{name} but it was not considered because it is for a different platform from the current one"
97
97
  end
98
98
 
@@ -77,7 +77,7 @@ module Bundler
77
77
  self.options ||= {}
78
78
  unprinted_warnings = Bundler.ui.unprinted_warnings
79
79
  Bundler.ui = UI::Shell.new(options)
80
- Bundler.ui.level = "debug" if options["verbose"]
80
+ Bundler.ui.level = "debug" if options[:verbose] || Bundler.settings[:verbose]
81
81
  unprinted_warnings.each {|w| Bundler.ui.warn(w) }
82
82
  end
83
83
 
@@ -130,7 +130,7 @@ module Bundler
130
130
 
131
131
  if man_pages.include?(command)
132
132
  man_page = man_pages[command]
133
- if Bundler.which("man") && !man_path.match?(%r{^file:/.+!/META-INF/jruby.home/.+})
133
+ if Bundler.which("man") && !man_path.match?(%r{^(?:file:/.+!|uri:classloader:)/META-INF/jruby.home/.+})
134
134
  Kernel.exec("man", man_page)
135
135
  else
136
136
  puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
@@ -220,7 +220,7 @@ module Bundler
220
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
- method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
223
+ method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
224
224
  method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
225
225
  method_option "path", type: :string, banner: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
226
226
  method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
@@ -232,15 +232,13 @@ module Bundler
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
235
- SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
236
-
237
235
  %w[clean deployment frozen no-prune path shebang without with].each do |option|
238
236
  remembered_flag_deprecation(option)
239
237
  end
240
238
 
241
239
  print_remembered_flag_deprecation("--system", "path.system", "true") if ARGV.include?("--system")
242
240
 
243
- remembered_negative_flag_deprecation("no-deployment")
241
+ remembered_flag_deprecation("deployment", negative: true)
244
242
 
245
243
  require_relative "cli/install"
246
244
  Bundler.settings.temporary(no_install: false) do
@@ -263,7 +261,7 @@ module Bundler
263
261
  method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
264
262
  method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
265
263
  method_option "source", type: :array, banner: "Update a specific source (and all gems associated with it)"
266
- method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
264
+ method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
267
265
  method_option "ruby", type: :boolean, banner: "Update ruby specified in Gemfile.lock"
268
266
  method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
269
267
  method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
@@ -274,7 +272,6 @@ module Bundler
274
272
  method_option "conservative", type: :boolean, banner: "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
275
273
  method_option "all", type: :boolean, banner: "Update everything."
276
274
  def update(*gems)
277
- SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
278
275
  require_relative "cli/update"
279
276
  Bundler.settings.temporary(no_install: false) do
280
277
  Update.new(options, gems).run
@@ -331,6 +328,8 @@ module Bundler
331
328
  method_option "all", type: :boolean, banner: "Install binstubs for all gems"
332
329
  method_option "all-platforms", type: :boolean, default: false, banner: "Install binstubs for all platforms"
333
330
  def binstubs(*gems)
331
+ remembered_flag_deprecation("path", option_name: "bin")
332
+
334
333
  require_relative "cli/binstubs"
335
334
  Binstubs.new(options, gems).run
336
335
  end
@@ -414,7 +413,7 @@ module Bundler
414
413
  def cache
415
414
  print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
416
415
 
417
- if ARGV.include?("--path")
416
+ if flag_passed?("--path")
418
417
  message =
419
418
  "The `--path` flag is deprecated because its semantics are unclear. " \
420
419
  "Use `bundle config cache_path` to configure the path of your cache of gems, " \
@@ -486,13 +485,13 @@ module Bundler
486
485
  def version
487
486
  cli_help = current_command.name == "cli_help"
488
487
  if cli_help || ARGV.include?("version")
489
- build_info = " (#{BuildMetadata.built_at} commit #{BuildMetadata.git_commit_sha})"
488
+ build_info = " (#{BuildMetadata.timestamp} commit #{BuildMetadata.git_commit_sha})"
490
489
  end
491
490
 
492
- if !cli_help && Bundler.feature_flag.print_only_version_number?
493
- Bundler.ui.info "#{Bundler::VERSION}#{build_info}"
491
+ if !cli_help && Bundler.feature_flag.bundler_4_mode?
492
+ Bundler.ui.info "#{Bundler.verbose_version}#{build_info}"
494
493
  else
495
- Bundler.ui.info "Bundler version #{Bundler::VERSION}#{build_info}"
494
+ Bundler.ui.info "Bundler version #{Bundler.verbose_version}#{build_info}"
496
495
  end
497
496
  end
498
497
 
@@ -512,7 +511,7 @@ module Bundler
512
511
  end
513
512
  end
514
513
 
515
- unless Bundler.feature_flag.bundler_3_mode?
514
+ unless Bundler.feature_flag.bundler_4_mode?
516
515
  desc "viz [OPTIONS]", "Generates a visual dependency graph", hide: true
517
516
  long_desc <<-D
518
517
  Viz generates a PNG file of the current Gemfile as a dependency graph.
@@ -544,6 +543,7 @@ module Bundler
544
543
  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
544
  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)`"
546
545
  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>`."
546
+ method_option :bundle, type: :boolean, default: Bundler.settings["gem.bundle"], desc: "Automatically run `bundle install` after creation. Set a default with `bundle config set --global gem.bundle true`"
547
547
 
548
548
  def gem(name)
549
549
  require_relative "cli/gem"
@@ -713,14 +713,9 @@ module Bundler
713
713
  command_name = cmd.name
714
714
  return if PARSEABLE_COMMANDS.include?(command_name)
715
715
  command = ["bundle", command_name] + args
716
- options_to_print = options.dup
717
- options_to_print.delete_if do |k, v|
718
- next unless o = cmd.options[k]
719
- o.default == v
720
- end
721
- command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
716
+ command << Thor::Options.to_switches(options.sort_by(&:first)).strip
722
717
  command.reject!(&:empty?)
723
- Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler::VERSION}"
718
+ Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler.verbose_version}"
724
719
  end
725
720
 
726
721
  def warn_on_outdated_bundler
@@ -747,30 +742,17 @@ module Bundler
747
742
  nil
748
743
  end
749
744
 
750
- def remembered_negative_flag_deprecation(name)
751
- positive_name = name.gsub(/\Ano-/, "")
752
- option = current_command.options[positive_name]
753
- flag_name = "--no-" + option.switch_name.gsub(/\A--/, "")
754
-
755
- flag_deprecation(positive_name, flag_name, option)
756
- end
757
-
758
- def remembered_flag_deprecation(name)
745
+ def remembered_flag_deprecation(name, negative: false, option_name: nil)
759
746
  option = current_command.options[name]
760
747
  flag_name = option.switch_name
761
-
762
- flag_deprecation(name, flag_name, option)
763
- end
764
-
765
- def flag_deprecation(name, flag_name, option)
766
- name_index = ARGV.find {|arg| flag_name == arg.split("=")[0] }
767
- return unless name_index
748
+ flag_name = "--no-" + flag_name.gsub(/\A--/, "") if negative
749
+ return unless flag_passed?(flag_name)
768
750
 
769
751
  value = options[name]
770
752
  value = value.join(" ").to_s if option.type == :array
771
753
  value = "'#{value}'" unless option.type == :boolean
772
754
 
773
- print_remembered_flag_deprecation(flag_name, name.tr("-", "_"), value)
755
+ print_remembered_flag_deprecation(flag_name, option_name || name.tr("-", "_"), value)
774
756
  end
775
757
 
776
758
  def print_remembered_flag_deprecation(flag_name, option_name, option_value)
@@ -786,5 +768,9 @@ module Bundler
786
768
  "#{option_value}`, and stop using this flag"
787
769
  Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
788
770
  end
771
+
772
+ def flag_passed?(name)
773
+ ARGV.any? {|arg| name == arg.split("=")[0] }
774
+ end
789
775
  end
790
776
  end
@@ -28,11 +28,7 @@ module Bundler
28
28
  # It may be called concurrently without global interpreter lock in some Rubies.
29
29
  # As a result, some methods may look more complex than necessary to save memory or time.
30
30
  class CompactIndexClient
31
- # NOTE: MD5 is here not because we expect a server to respond with it, but
32
- # because we use it to generate the etag on first request during the upgrade
33
- # to the compact index client that uses opaque etags saved to files.
34
- # Remove once 2.5.0 has been out for a while.
35
- SUPPORTED_DIGESTS = { "sha-256" => :SHA256, "md5" => :MD5 }.freeze
31
+ SUPPORTED_DIGESTS = { "sha-256" => :SHA256 }.freeze
36
32
  DEBUG_MUTEX = Thread::Mutex.new
37
33
 
38
34
  # info returns an Array of INFO Arrays. Each INFO Array has the following indices: