rubygems-update 3.7.0 → 3.7.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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +47 -0
  3. data/CODE_OF_CONDUCT.md +1 -1
  4. data/bundler/CHANGELOG.md +43 -0
  5. data/bundler/lib/bundler/build_metadata.rb +2 -2
  6. data/bundler/lib/bundler/checksum.rb +6 -0
  7. data/bundler/lib/bundler/cli/cache.rb +0 -1
  8. data/bundler/lib/bundler/cli/common.rb +1 -1
  9. data/bundler/lib/bundler/cli/install.rb +1 -3
  10. data/bundler/lib/bundler/cli/lock.rb +5 -5
  11. data/bundler/lib/bundler/cli/show.rb +2 -6
  12. data/bundler/lib/bundler/cli/update.rb +1 -1
  13. data/bundler/lib/bundler/cli.rb +43 -43
  14. data/bundler/lib/bundler/definition.rb +77 -60
  15. data/bundler/lib/bundler/dsl.rb +1 -1
  16. data/bundler/lib/bundler/feature_flag.rb +1 -1
  17. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  18. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  19. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  20. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  21. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  22. data/bundler/lib/bundler/man/bundle-config.1 +31 -14
  23. data/bundler/lib/bundler/man/bundle-config.1.ronn +49 -20
  24. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-doctor.1 +4 -4
  26. data/bundler/lib/bundler/man/bundle-doctor.1.ronn +4 -4
  27. data/bundler/lib/bundler/man/bundle-env.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-fund.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-install.1 +4 -4
  36. data/bundler/lib/bundler/man/bundle-install.1.ronn +3 -4
  37. data/bundler/lib/bundler/man/bundle-issue.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-licenses.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-plugin.1 +40 -15
  45. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +44 -15
  46. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  49. data/bundler/lib/bundler/man/bundle-update.1 +5 -5
  50. data/bundler/lib/bundler/man/bundle-update.1.ronn +4 -4
  51. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle.1 +1 -1
  54. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  55. data/bundler/lib/bundler/resolver/package.rb +1 -0
  56. data/bundler/lib/bundler/settings.rb +1 -1
  57. data/bundler/lib/bundler/source/gemspec.rb +4 -0
  58. data/bundler/lib/bundler/source/path.rb +2 -0
  59. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -3
  60. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +42 -6
  61. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +1 -1
  62. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +1 -1
  63. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +3 -7
  64. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  65. data/bundler/lib/bundler/version.rb +1 -1
  66. data/doc/bundler/UPGRADING.md +0 -27
  67. data/lib/rubygems/commands/sources_command.rb +122 -18
  68. data/lib/rubygems/defaults.rb +1 -1
  69. data/lib/rubygems/exceptions.rb +3 -12
  70. data/lib/rubygems/platform.rb +1 -1
  71. data/lib/rubygems/s3_uri_signer.rb +54 -7
  72. data/lib/rubygems/source_list.rb +36 -0
  73. data/lib/rubygems.rb +8 -1
  74. data/rubygems-update.gemspec +1 -1
  75. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03e7b453f94a861359f6485b6b5113895c42bd5b115e06dfb97a18c89e136aa7
4
- data.tar.gz: 51c23100811f64573af66733dc850a4df04f077cb235e8bd88fd908537df10b9
3
+ metadata.gz: 007bf5bf46815ca5f13cbd1cd51e2faf06e6efad4281ab9d9c4bd5c7e88510aa
4
+ data.tar.gz: 29765768c50992b42513cd0ffde3f8bf1b796da1ddb7e31c860d9bec9ef47746
5
5
  SHA512:
6
- metadata.gz: 57bbca0ebbc735327ea38fd5642c568f62b83b3699d0ddf82bdb3743de55d2ac868b6def1d2745e52db6e1edacfc1c03af24c25c330eb7645942e8228f52e5d8
7
- data.tar.gz: be39f5dd45659e7887659734a0b524461bbd45923d323eaf4045b744f2fee2372302e00325da6cf9d7e82fc7d1826fe485cd209a3f59afa39403d79152e5f838
6
+ metadata.gz: ea81cdb4721a8ea49e00ff12d84c4078b9022519b743fc1a7698bd50faecab6c11192fc88fba070004d09bfbeb7b75e148fb623c021d9872ef430b2eaddf9b38
7
+ data.tar.gz: c0f25295d10d7d1af8192538a4f65e7cdba45554510e8d1219f0c088020ea498c12bacd5f07bbd23534e50ba6bc501cf2f136f93e9de498d812563a8cbf248f6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.7.2 / 2025-09-09
4
+
5
+ ### Enhancements:
6
+
7
+ * `gem sources --prepend` and `--append` allow finer grained control of
8
+ sources. Pull request
9
+ [#8901](https://github.com/rubygems/rubygems/pull/8901) by martinemde
10
+ * Improve `gem sources --remove` output. Pull request
11
+ [#8909](https://github.com/rubygems/rubygems/pull/8909) by
12
+ deivid-rodriguez
13
+ * Make `gem sources` output more clear. Pull request
14
+ [#8938](https://github.com/rubygems/rubygems/pull/8938) by
15
+ deivid-rodriguez
16
+ * Use IMDSv2 for S3 instance credentials. Pull request
17
+ [#7709](https://github.com/rubygems/rubygems/pull/7709) by
18
+ folbricht-stripe
19
+ * Installs bundler 2.7.2 as a default gem.
20
+
21
+ ### Bug fixes:
22
+
23
+ * Fix "did you mean" suggestions for unknown commands. Pull request
24
+ [#8948](https://github.com/rubygems/rubygems/pull/8948) by
25
+ deivid-rodriguez
26
+ * Fix trailing slashes not considered by `gem sources --remove`. Pull
27
+ request [#8939](https://github.com/rubygems/rubygems/pull/8939) by
28
+ deivid-rodriguez
29
+
30
+ ## 3.7.1 / 2025-07-21
31
+
32
+ ### Enhancements:
33
+
34
+ * Fix regression in presence of RVM gems. Pull request
35
+ [#8854](https://github.com/rubygems/rubygems/pull/8854) by
36
+ deivid-rodriguez
37
+ * Restore parsing "--" as an unknown platform rather than crashing. Pull
38
+ request [#8846](https://github.com/rubygems/rubygems/pull/8846) by
39
+ deivid-rodriguez
40
+ * Installs bundler 2.7.1 as a default gem.
41
+
42
+ ### Documentation:
43
+
44
+ * Use mailto link in Code of Conduct. Pull request
45
+ [#8849](https://github.com/rubygems/rubygems/pull/8849) by
46
+ deivid-rodriguez
47
+ * Update Code of Conduct email to conduct@rubygems.org. Pull request
48
+ [#8848](https://github.com/rubygems/rubygems/pull/8848) by indirect
49
+
3
50
  ## 3.7.0 / 2025-07-16
4
51
 
5
52
  ### Security:
data/CODE_OF_CONDUCT.md CHANGED
@@ -60,7 +60,7 @@ representative at an online or offline event.
60
60
 
61
61
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
62
  reported to the community leaders responsible for enforcement at
63
- team@bundler.io.
63
+ [conduct@rubygems.org](mailto:conduct@rubygems.org).
64
64
  All complaints will be reviewed and investigated promptly and fairly.
65
65
 
66
66
  All community leaders are obligated to respect the privacy and security of the
data/bundler/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.7.2 (2025-09-09)
4
+
5
+ ### Enhancements:
6
+
7
+ - Improve error message when the same source is specified through `gemspec` and `path` [#8460](https://github.com/rubygems/rubygems/pull/8460)
8
+ - Raise an error in frozen mode if some registry gems have empty checksums [#8888](https://github.com/rubygems/rubygems/pull/8888)
9
+ - Bump vendored thor to 1.4.0 [#8883](https://github.com/rubygems/rubygems/pull/8883)
10
+ - Delay default path and global cache changes to Bundler 5 [#8867](https://github.com/rubygems/rubygems/pull/8867)
11
+ - Fix spacing in bundle gem newgem.gemspec.tt [#8865](https://github.com/rubygems/rubygems/pull/8865)
12
+
13
+ ### Bug fixes:
14
+
15
+ - Fix `bundle cache --frozen` and `bundle cache --no-prune` not printing a deprecation message [#8926](https://github.com/rubygems/rubygems/pull/8926)
16
+ - Fix local installation incorrectly forced if there's a `vendor/cache` directory and frozen mode is set [#8925](https://github.com/rubygems/rubygems/pull/8925)
17
+ - Fix `bundle lock --update <gem>` with `--lockfile` flag updating all gems [#8922](https://github.com/rubygems/rubygems/pull/8922)
18
+ - Fix `bundle show --verbose` and recommend it as an alternative to `bundle show --outdated` [#8915](https://github.com/rubygems/rubygems/pull/8915)
19
+ - Fix `bundle cache --no-all` not printing a deprecation warning [#8912](https://github.com/rubygems/rubygems/pull/8912)
20
+ - Fix `bundle update foo` unable to update foo in an edge case [#8897](https://github.com/rubygems/rubygems/pull/8897)
21
+ - Fix Bundler printing more flags than actually passed in verbose mode [#8914](https://github.com/rubygems/rubygems/pull/8914)
22
+ - Fix bundler failing to install sorbet-static in truffleruby when there's no lockfile [#8872](https://github.com/rubygems/rubygems/pull/8872)
23
+
24
+ ### Documentation:
25
+
26
+ - Improve documentation of `bundle doctor`, `bundle plugin`, and `bundle config` [#8919](https://github.com/rubygems/rubygems/pull/8919)
27
+ - Make sure all CLI flags and subcommands are documented [#8861](https://github.com/rubygems/rubygems/pull/8861)
28
+
29
+ ## 2.7.1 (2025-07-21)
30
+
31
+ ### Enhancements:
32
+
33
+ - Add some missing deprecation messages [#8844](https://github.com/rubygems/rubygems/pull/8844)
34
+
35
+ ### Bug fixes:
36
+
37
+ - Cancel deprecation of `--force` flag to `bundle install` and `bundle update` [#8843](https://github.com/rubygems/rubygems/pull/8843)
38
+
39
+ ### Documentation:
40
+
41
+ - Clarify documentation about new default gem installation directory in Bundler 4 [#8857](https://github.com/rubygems/rubygems/pull/8857)
42
+ - Use mailto link in Code of Conduct [#8849](https://github.com/rubygems/rubygems/pull/8849)
43
+ - Update Code of Conduct email to conduct@rubygems.org [#8848](https://github.com/rubygems/rubygems/pull/8848)
44
+ - Add missing link to `irb` repo in DEBUGGING.md [#8842](https://github.com/rubygems/rubygems/pull/8842)
45
+
3
46
  ## 2.7.0 (2025-07-16)
4
47
 
5
48
  ### Breaking changes:
@@ -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 = "2025-07-16".freeze
8
- @git_commit_sha = "24a46f4f3d6".freeze
7
+ @built_at = "2025-09-09".freeze
8
+ @git_commit_sha = "b463ced1459".freeze
9
9
  # end ivars
10
10
 
11
11
  # A hash representation of the build metadata.
@@ -205,6 +205,12 @@ module Bundler
205
205
  @store[spec.lock_name].nil?
206
206
  end
207
207
 
208
+ def empty?(spec)
209
+ return false unless spec.source.is_a?(Bundler::Source::Rubygems)
210
+
211
+ @store[spec.lock_name].empty?
212
+ end
213
+
208
214
  def register(spec, checksum)
209
215
  register_checksum(spec.lock_name, checksum)
210
216
  end
@@ -16,7 +16,6 @@ module Bundler
16
16
  setup_cache_all
17
17
  install
18
18
 
19
- # TODO: move cache contents here now that all bundles are locked
20
19
  custom_path = Bundler.settings[:path] if options[:path]
21
20
 
22
21
  Bundler.settings.temporary(cache_all_platforms: options["all-platforms"]) do
@@ -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.bundler_4_mode? && Bundler.settings[:path].nil?
133
+ clean ||= Bundler.feature_flag.bundler_5_mode? && Bundler.settings[:path].nil?
134
134
  clean &&= !Bundler.use_system_gems?
135
135
  clean
136
136
  end
@@ -42,8 +42,6 @@ module Bundler
42
42
  "before deploying."
43
43
  end
44
44
 
45
- options[:local] = true if Bundler.app_cache.exist?
46
-
47
45
  Bundler.settings.set_command_option :deployment, true if options[:deployment]
48
46
  Bundler.settings.set_command_option :frozen, true if options[:frozen]
49
47
  end
@@ -179,7 +177,7 @@ module Bundler
179
177
 
180
178
  normalize_groups if options[:without] || options[:with]
181
179
 
182
- options[:force] = options[:redownload]
180
+ options[:force] = options[:redownload] if options[:redownload]
183
181
  end
184
182
 
185
183
  def warn_ambiguous_gems
@@ -35,11 +35,8 @@ module Bundler
35
35
  update = { bundler: bundler }
36
36
  end
37
37
 
38
- file = options[:lockfile]
39
- file = file ? Pathname.new(file).expand_path : Bundler.default_lockfile
40
-
41
38
  Bundler.settings.temporary(frozen: false) do
42
- definition = Bundler.definition(update, file)
39
+ definition = Bundler.definition(update, Bundler.default_lockfile)
43
40
  definition.add_checksums if options["add-checksums"]
44
41
 
45
42
  Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
@@ -71,8 +68,11 @@ module Bundler
71
68
  if print
72
69
  puts definition.to_lock
73
70
  else
71
+ file = options[:lockfile]
72
+ file = file ? Pathname.new(file).expand_path : Bundler.default_lockfile
73
+
74
74
  puts "Writing lockfile to #{file}"
75
- definition.lock
75
+ definition.write_lock(file, false)
76
76
  end
77
77
  end
78
78
 
@@ -57,12 +57,8 @@ module Bundler
57
57
 
58
58
  def fetch_latest_specs
59
59
  definition = Bundler.definition(true)
60
- if options[:outdated]
61
- Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
62
- Bundler.ui.silence { definition.remotely! }
63
- else
64
- definition.with_cache!
65
- end
60
+ Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
61
+ Bundler.ui.silence { definition.remotely! }
66
62
  Bundler.reset!
67
63
  definition.specs
68
64
  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
 
@@ -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
@@ -290,8 +287,8 @@ module Bundler
290
287
  method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
291
288
  def show(gem_name = nil)
292
289
  if ARGV.include?("--outdated")
293
- message = "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement"
294
- removed_message = "the `--outdated` flag to `bundle show` was undocumented and has been removed without replacement"
290
+ message = "the `--outdated` flag to `bundle show` will be removed in favor of `bundle show --verbose`"
291
+ removed_message = "the `--outdated` flag to `bundle show` has been removed in favor of `bundle show --verbose`"
295
292
  SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
296
293
  end
297
294
  require_relative "cli/show"
@@ -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
@@ -413,8 +412,13 @@ module Bundler
413
412
  D
414
413
  def cache
415
414
  print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
415
+ print_remembered_flag_deprecation("--no-all", "cache_all", "false") if ARGV.include?("--no-all")
416
416
 
417
- if ARGV.include?("--path")
417
+ %w[frozen no-prune].each do |option|
418
+ remembered_flag_deprecation(option)
419
+ end
420
+
421
+ if flag_passed?("--path")
418
422
  message =
419
423
  "The `--path` flag is deprecated because its semantics are unclear. " \
420
424
  "Use `bundle config cache_path` to configure the path of your cache of gems, " \
@@ -519,11 +523,11 @@ module Bundler
519
523
  Viz requires the ruby-graphviz gem (and its dependencies).
520
524
  The associated gems must also be installed via 'bundle install'.
521
525
  D
522
- method_option :file, type: :string, default: "gem_graph", aliases: "-f", desc: "The name to use for the generated file. see format option"
523
- method_option :format, type: :string, default: "png", aliases: "-F", desc: "This is output format option. Supported format is png, jpg, svg, dot ..."
524
- method_option :requirements, type: :boolean, default: false, aliases: "-R", desc: "Set to show the version of each required dependency."
525
- method_option :version, type: :boolean, default: false, aliases: "-v", desc: "Set to show each gem version."
526
- method_option :without, type: :array, default: [], aliases: "-W", banner: "GROUP[ GROUP...]", desc: "Exclude gems that are part of the specified named group."
526
+ method_option :file, type: :string, default: "gem_graph", aliases: "-f", banner: "The name to use for the generated file. see format option"
527
+ method_option :format, type: :string, default: "png", aliases: "-F", banner: "This is output format option. Supported format is png, jpg, svg, dot ..."
528
+ method_option :requirements, type: :boolean, default: false, aliases: "-R", banner: "Set to show the version of each required dependency."
529
+ method_option :version, type: :boolean, default: false, aliases: "-v", banner: "Set to show each gem version."
530
+ method_option :without, type: :array, default: [], aliases: "-W", banner: "Exclude gems that are part of the specified named group."
527
531
  def viz
528
532
  SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
529
533
  require_relative "cli/viz"
@@ -532,19 +536,19 @@ module Bundler
532
536
  end
533
537
 
534
538
  desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
535
- method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], desc: "Generate a binary executable for your library."
536
- method_option :coc, type: :boolean, desc: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
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)"
538
- method_option :ext, type: :string, desc: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
539
- method_option :git, type: :boolean, default: true, desc: "Initialize a git repo inside your library."
540
- method_option :mit, type: :boolean, desc: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
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`."
542
- method_option :changelog, type: :boolean, desc: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
539
+ method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], banner: "Generate a binary executable for your library."
540
+ method_option :coc, type: :boolean, banner: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
541
+ method_option :edit, type: :string, aliases: "-e", required: false, lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, banner: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
542
+ method_option :ext, type: :string, banner: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
543
+ method_option :git, type: :boolean, default: true, banner: "Initialize a git repo inside your library."
544
+ method_option :mit, type: :boolean, banner: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
545
+ method_option :rubocop, type: :boolean, banner: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
546
+ method_option :changelog, type: :boolean, banner: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
543
547
  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)`"
548
+ method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], banner: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
549
+ method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], banner: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
546
550
  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>`."
547
- 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`"
551
+ method_option :bundle, type: :boolean, default: Bundler.settings["gem.bundle"], banner: "Automatically run `bundle install` after creation. Set a default with `bundle config set --global gem.bundle true`"
548
552
 
549
553
  def gem(name)
550
554
  require_relative "cli/gem"
@@ -714,7 +718,12 @@ module Bundler
714
718
  command_name = cmd.name
715
719
  return if PARSEABLE_COMMANDS.include?(command_name)
716
720
  command = ["bundle", command_name] + args
717
- command << Thor::Options.to_switches(options.sort_by(&:first)).strip
721
+ options_to_print = options.dup
722
+ options_to_print.delete_if do |k, v|
723
+ next unless o = cmd.options[k]
724
+ o.default == v
725
+ end
726
+ command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
718
727
  command.reject!(&:empty?)
719
728
  Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler.verbose_version}"
720
729
  end
@@ -743,30 +752,17 @@ module Bundler
743
752
  nil
744
753
  end
745
754
 
746
- def remembered_negative_flag_deprecation(name)
747
- positive_name = name.gsub(/\Ano-/, "")
748
- option = current_command.options[positive_name]
749
- flag_name = "--no-" + option.switch_name.gsub(/\A--/, "")
750
-
751
- flag_deprecation(positive_name, flag_name, option)
752
- end
753
-
754
- def remembered_flag_deprecation(name)
755
+ def remembered_flag_deprecation(name, negative: false, option_name: nil)
755
756
  option = current_command.options[name]
756
757
  flag_name = option.switch_name
757
-
758
- flag_deprecation(name, flag_name, option)
759
- end
760
-
761
- def flag_deprecation(name, flag_name, option)
762
- name_index = ARGV.find {|arg| flag_name == arg.split("=")[0] }
763
- return unless name_index
758
+ flag_name = "--no-" + flag_name.gsub(/\A--/, "") if negative
759
+ return unless flag_passed?(flag_name)
764
760
 
765
761
  value = options[name]
766
762
  value = value.join(" ").to_s if option.type == :array
767
763
  value = "'#{value}'" unless option.type == :boolean
768
764
 
769
- print_remembered_flag_deprecation(flag_name, name.tr("-", "_"), value)
765
+ print_remembered_flag_deprecation(flag_name, option_name || name.tr("-", "_"), value)
770
766
  end
771
767
 
772
768
  def print_remembered_flag_deprecation(flag_name, option_name, option_value)
@@ -782,5 +778,9 @@ module Bundler
782
778
  "#{option_value}`, and stop using this flag"
783
779
  Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
784
780
  end
781
+
782
+ def flag_passed?(name)
783
+ ARGV.any? {|arg| name == arg.split("=")[0] }
784
+ end
785
785
  end
786
786
  end