bundler 2.7.0 → 2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -0
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/checksum.rb +6 -0
- data/lib/bundler/cli/cache.rb +0 -1
- data/lib/bundler/cli/common.rb +1 -1
- data/lib/bundler/cli/install.rb +1 -3
- data/lib/bundler/cli/lock.rb +5 -5
- data/lib/bundler/cli/show.rb +2 -6
- data/lib/bundler/cli/update.rb +1 -1
- data/lib/bundler/cli.rb +43 -43
- data/lib/bundler/definition.rb +77 -60
- data/lib/bundler/dsl.rb +1 -1
- data/lib/bundler/feature_flag.rb +1 -1
- data/lib/bundler/man/bundle-add.1 +1 -1
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +1 -1
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +31 -14
- data/lib/bundler/man/bundle-config.1.ronn +49 -20
- data/lib/bundler/man/bundle-console.1 +1 -1
- data/lib/bundler/man/bundle-doctor.1 +4 -4
- data/lib/bundler/man/bundle-doctor.1.ronn +4 -4
- data/lib/bundler/man/bundle-env.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +1 -1
- data/lib/bundler/man/bundle-fund.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +1 -1
- data/lib/bundler/man/bundle-help.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-inject.1 +1 -1
- data/lib/bundler/man/bundle-install.1 +4 -4
- data/lib/bundler/man/bundle-install.1.ronn +3 -4
- data/lib/bundler/man/bundle-issue.1 +1 -1
- data/lib/bundler/man/bundle-licenses.1 +1 -1
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-plugin.1 +40 -15
- data/lib/bundler/man/bundle-plugin.1.ronn +44 -15
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-show.1 +1 -1
- data/lib/bundler/man/bundle-update.1 +5 -5
- data/lib/bundler/man/bundle-update.1.ronn +4 -4
- data/lib/bundler/man/bundle-version.1 +1 -1
- data/lib/bundler/man/bundle-viz.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +1 -1
- data/lib/bundler/resolver/package.rb +1 -0
- data/lib/bundler/settings.rb +1 -1
- data/lib/bundler/source/gemspec.rb +4 -0
- data/lib/bundler/source/path.rb +2 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -3
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +42 -6
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +3 -7
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1982c5c69b6f594a4722d67fe1dbdf4e172d4d5bb2f668dcf2d761b5b586073
|
4
|
+
data.tar.gz: 4ba353e26a9532c811867f2d5fd670ada1399800e9eef227777273cd18f7cfe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3e5ca074599e8ef171e40134035e3f676ea99bcb9dda2aa1b4fea8d36cc31fac0b57e2751799ece3232b7cdf8df0c8dd85ccf4c95b1306552fd80915847e8c8
|
7
|
+
data.tar.gz: 2700a932263a8da12c748917da79cd8e058085a7b6db00bbbec6c60cffb671bb939d5ebc47f842083b9f0bbd5c139dd40d7ada3fb13b7a91abca2f97320b7b11
|
data/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-
|
8
|
-
@git_commit_sha = "
|
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.
|
data/lib/bundler/checksum.rb
CHANGED
@@ -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
|
data/lib/bundler/cli/cache.rb
CHANGED
data/lib/bundler/cli/common.rb
CHANGED
@@ -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.
|
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
|
data/lib/bundler/cli/install.rb
CHANGED
@@ -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
|
data/lib/bundler/cli/lock.rb
CHANGED
@@ -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,
|
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.
|
75
|
+
definition.write_lock(file, false)
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
data/lib/bundler/cli/show.rb
CHANGED
@@ -57,12 +57,8 @@ module Bundler
|
|
57
57
|
|
58
58
|
def fetch_latest_specs
|
59
59
|
definition = Bundler.definition(true)
|
60
|
-
|
61
|
-
|
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
|
data/lib/bundler/cli/update.rb
CHANGED
@@ -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
|
|
data/lib/bundler/cli.rb
CHANGED
@@ -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 "
|
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
|
-
|
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 "
|
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`
|
294
|
-
removed_message = "the `--outdated` flag to `bundle show`
|
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
|
-
|
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",
|
523
|
-
method_option :format, type: :string, default: "png", aliases: "-F",
|
524
|
-
method_option :requirements, type: :boolean, default: false, aliases: "-R",
|
525
|
-
method_option :version, type: :boolean, default: false, aliases: "-v",
|
526
|
-
method_option :without, type: :array, default: [], aliases: "-W", banner: "
|
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"],
|
536
|
-
method_option :coc, type: :boolean,
|
537
|
-
method_option :edit, type: :string, aliases: "-e", required: false,
|
538
|
-
method_option :ext, type: :string,
|
539
|
-
method_option :git, type: :boolean, default: true,
|
540
|
-
method_option :mit, type: :boolean,
|
541
|
-
method_option :rubocop, type: :boolean,
|
542
|
-
method_option :changelog, type: :boolean,
|
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],
|
545
|
-
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[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"],
|
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
|
-
|
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
|
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
|
-
|
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
|
data/lib/bundler/definition.rb
CHANGED
@@ -189,12 +189,14 @@ module Bundler
|
|
189
189
|
def setup_domain!(options = {})
|
190
190
|
prefer_local! if options[:"prefer-local"]
|
191
191
|
|
192
|
+
sources.cached!
|
193
|
+
|
192
194
|
if options[:add_checksums] || (!options[:local] && install_needed?)
|
193
|
-
|
195
|
+
sources.remote!
|
194
196
|
true
|
195
197
|
else
|
196
198
|
Bundler.settings.set_command_option(:jobs, 1) unless install_needed? # to avoid the overhead of Bundler::Worker
|
197
|
-
|
199
|
+
sources.local!
|
198
200
|
false
|
199
201
|
end
|
200
202
|
end
|
@@ -373,6 +375,44 @@ module Bundler
|
|
373
375
|
write_lock(target_lockfile, preserve_unknown_sections)
|
374
376
|
end
|
375
377
|
|
378
|
+
def write_lock(file, preserve_unknown_sections)
|
379
|
+
return if Definition.no_lock || file.nil?
|
380
|
+
|
381
|
+
contents = to_lock
|
382
|
+
|
383
|
+
# Convert to \r\n if the existing lock has them
|
384
|
+
# i.e., Windows with `git config core.autocrlf=true`
|
385
|
+
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match?("\r\n")
|
386
|
+
|
387
|
+
if @locked_bundler_version
|
388
|
+
locked_major = @locked_bundler_version.segments.first
|
389
|
+
current_major = bundler_version_to_lock.segments.first
|
390
|
+
|
391
|
+
updating_major = locked_major < current_major
|
392
|
+
end
|
393
|
+
|
394
|
+
preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
|
395
|
+
|
396
|
+
if File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
|
397
|
+
return if Bundler.frozen_bundle?
|
398
|
+
SharedHelpers.filesystem_access(file) { FileUtils.touch(file) }
|
399
|
+
return
|
400
|
+
end
|
401
|
+
|
402
|
+
if Bundler.frozen_bundle?
|
403
|
+
Bundler.ui.error "Cannot write a changed lockfile while frozen."
|
404
|
+
return
|
405
|
+
end
|
406
|
+
|
407
|
+
begin
|
408
|
+
SharedHelpers.filesystem_access(file) do |p|
|
409
|
+
File.open(p, "wb") {|f| f.puts(contents) }
|
410
|
+
end
|
411
|
+
rescue ReadOnlyFileSystemError
|
412
|
+
raise ProductionError, lockfile_changes_summary("file system is read-only")
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
376
416
|
def locked_ruby_version
|
377
417
|
return unless ruby_version
|
378
418
|
if @unlocking_ruby || !@locked_ruby_version
|
@@ -492,8 +532,6 @@ module Bundler
|
|
492
532
|
@unlocking
|
493
533
|
end
|
494
534
|
|
495
|
-
attr_writer :source_requirements
|
496
|
-
|
497
535
|
def add_checksums
|
498
536
|
@locked_checksums = true
|
499
537
|
|
@@ -533,7 +571,7 @@ module Bundler
|
|
533
571
|
|
534
572
|
return unless added.any? || deleted.any? || changed.any? || resolve_needed?
|
535
573
|
|
536
|
-
msg = String.new("#{change_reason.
|
574
|
+
msg = String.new("#{change_reason[0].upcase}#{change_reason[1..-1].strip}, but ")
|
537
575
|
msg << "the lockfile " unless msg.start_with?("Your lockfile")
|
538
576
|
msg << "can't be updated because #{update_refused_reason}"
|
539
577
|
msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any?
|
@@ -559,6 +597,7 @@ module Bundler
|
|
559
597
|
@missing_lockfile_dep ||
|
560
598
|
@unlocking_bundler ||
|
561
599
|
@locked_spec_with_missing_checksums ||
|
600
|
+
@locked_spec_with_empty_checksums ||
|
562
601
|
@locked_spec_with_missing_deps ||
|
563
602
|
@locked_spec_with_invalid_deps
|
564
603
|
end
|
@@ -575,46 +614,8 @@ module Bundler
|
|
575
614
|
lockfile && File.exist?(lockfile)
|
576
615
|
end
|
577
616
|
|
578
|
-
def write_lock(file, preserve_unknown_sections)
|
579
|
-
return if Definition.no_lock || file.nil?
|
580
|
-
|
581
|
-
contents = to_lock
|
582
|
-
|
583
|
-
# Convert to \r\n if the existing lock has them
|
584
|
-
# i.e., Windows with `git config core.autocrlf=true`
|
585
|
-
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match?("\r\n")
|
586
|
-
|
587
|
-
if @locked_bundler_version
|
588
|
-
locked_major = @locked_bundler_version.segments.first
|
589
|
-
current_major = bundler_version_to_lock.segments.first
|
590
|
-
|
591
|
-
updating_major = locked_major < current_major
|
592
|
-
end
|
593
|
-
|
594
|
-
preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
|
595
|
-
|
596
|
-
if File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
|
597
|
-
return if Bundler.frozen_bundle?
|
598
|
-
SharedHelpers.filesystem_access(file) { FileUtils.touch(file) }
|
599
|
-
return
|
600
|
-
end
|
601
|
-
|
602
|
-
if Bundler.frozen_bundle?
|
603
|
-
Bundler.ui.error "Cannot write a changed lockfile while frozen."
|
604
|
-
return
|
605
|
-
end
|
606
|
-
|
607
|
-
begin
|
608
|
-
SharedHelpers.filesystem_access(file) do |p|
|
609
|
-
File.open(p, "wb") {|f| f.puts(contents) }
|
610
|
-
end
|
611
|
-
rescue ReadOnlyFileSystemError
|
612
|
-
raise ProductionError, lockfile_changes_summary("file system is read-only")
|
613
|
-
end
|
614
|
-
end
|
615
|
-
|
616
617
|
def resolver
|
617
|
-
@resolver ||=
|
618
|
+
@resolver ||= new_resolver(resolution_base)
|
618
619
|
end
|
619
620
|
|
620
621
|
def expanded_dependencies
|
@@ -632,8 +633,7 @@ module Bundler
|
|
632
633
|
@resolution_base ||= begin
|
633
634
|
last_resolve = converge_locked_specs
|
634
635
|
remove_invalid_platforms!
|
635
|
-
|
636
|
-
base = Resolver::Base.new(source_requirements, expanded_dependencies, last_resolve, @platforms, locked_specs: @originally_locked_specs, unlock: @unlocking_all || @gems_to_unlock, prerelease: gem_version_promoter.pre?, prefer_local: @prefer_local, new_platforms: new_resolution_platforms)
|
636
|
+
base = new_resolution_base(last_resolve: last_resolve, unlock: @unlocking_all || @gems_to_unlock)
|
637
637
|
base = additional_base_requirements_to_prevent_downgrades(base)
|
638
638
|
base = additional_base_requirements_to_force_updates(base)
|
639
639
|
base
|
@@ -740,7 +740,6 @@ module Bundler
|
|
740
740
|
def start_resolution
|
741
741
|
local_platform_needed_for_resolvability = @most_specific_non_local_locked_platform && !@platforms.include?(Bundler.local_platform)
|
742
742
|
@platforms << Bundler.local_platform if local_platform_needed_for_resolvability
|
743
|
-
add_platform(Gem::Platform::RUBY) if RUBY_ENGINE == "truffleruby"
|
744
743
|
|
745
744
|
result = SpecSet.new(resolver.start)
|
746
745
|
|
@@ -848,6 +847,7 @@ module Bundler
|
|
848
847
|
[@missing_lockfile_dep, "your lockfile is missing \"#{@missing_lockfile_dep}\""],
|
849
848
|
[@unlocking_bundler, "an update to the version of Bundler itself was requested"],
|
850
849
|
[@locked_spec_with_missing_checksums, "your lockfile is missing a CHECKSUMS entry for \"#{@locked_spec_with_missing_checksums}\""],
|
850
|
+
[@locked_spec_with_empty_checksums, "your lockfile has an empty CHECKSUMS entry for \"#{@locked_spec_with_empty_checksums}\""],
|
851
851
|
[@locked_spec_with_missing_deps, "your lockfile includes \"#{@locked_spec_with_missing_deps}\" but not some of its dependencies"],
|
852
852
|
[@locked_spec_with_invalid_deps, "your lockfile does not satisfy dependencies of \"#{@locked_spec_with_invalid_deps}\""],
|
853
853
|
].select(&:first).map(&:last).join(", ")
|
@@ -907,13 +907,23 @@ module Bundler
|
|
907
907
|
@locked_spec_with_invalid_deps = nil
|
908
908
|
@locked_spec_with_missing_deps = nil
|
909
909
|
@locked_spec_with_missing_checksums = nil
|
910
|
+
@locked_spec_with_empty_checksums = nil
|
910
911
|
|
911
912
|
missing_deps = []
|
912
913
|
missing_checksums = []
|
914
|
+
empty_checksums = []
|
913
915
|
invalid = []
|
914
916
|
|
915
917
|
@locked_specs.each do |s|
|
916
|
-
|
918
|
+
if @locked_checksums
|
919
|
+
checksum_store = s.source.checksum_store
|
920
|
+
|
921
|
+
if checksum_store.missing?(s)
|
922
|
+
missing_checksums << s
|
923
|
+
elsif checksum_store.empty?(s)
|
924
|
+
empty_checksums << s
|
925
|
+
end
|
926
|
+
end
|
917
927
|
|
918
928
|
validation = @locked_specs.validate_deps(s)
|
919
929
|
|
@@ -922,6 +932,7 @@ module Bundler
|
|
922
932
|
end
|
923
933
|
|
924
934
|
@locked_spec_with_missing_checksums = missing_checksums.first.name if missing_checksums.any?
|
935
|
+
@locked_spec_with_empty_checksums = empty_checksums.first.name if empty_checksums.any?
|
925
936
|
|
926
937
|
if missing_deps.any?
|
927
938
|
@locked_specs.delete(missing_deps)
|
@@ -1145,7 +1156,7 @@ module Bundler
|
|
1145
1156
|
|
1146
1157
|
def additional_base_requirements_to_force_updates(resolution_base)
|
1147
1158
|
return resolution_base if @explicit_unlocks.empty?
|
1148
|
-
full_update =
|
1159
|
+
full_update = SpecSet.new(new_resolver_for_full_update.start)
|
1149
1160
|
@explicit_unlocks.each do |name|
|
1150
1161
|
version = full_update.version_for(name)
|
1151
1162
|
resolution_base.base_requirements[name] = Gem::Requirement.new("= #{version}") if version
|
@@ -1153,17 +1164,6 @@ module Bundler
|
|
1153
1164
|
resolution_base
|
1154
1165
|
end
|
1155
1166
|
|
1156
|
-
def dup_for_full_unlock
|
1157
|
-
unlocked_definition = self.class.new(@lockfile, @dependencies, @sources, true, @ruby_version, @optional_groups, @gemfiles)
|
1158
|
-
unlocked_definition.source_requirements = source_requirements
|
1159
|
-
unlocked_definition.gem_version_promoter.tap do |gvp|
|
1160
|
-
gvp.level = gem_version_promoter.level
|
1161
|
-
gvp.strict = gem_version_promoter.strict
|
1162
|
-
gvp.pre = gem_version_promoter.pre
|
1163
|
-
end
|
1164
|
-
unlocked_definition
|
1165
|
-
end
|
1166
|
-
|
1167
1167
|
def remove_invalid_platforms!
|
1168
1168
|
return if Bundler.frozen_bundle?
|
1169
1169
|
|
@@ -1182,5 +1182,22 @@ module Bundler
|
|
1182
1182
|
def source_map
|
1183
1183
|
@source_map ||= SourceMap.new(sources, dependencies, @locked_specs)
|
1184
1184
|
end
|
1185
|
+
|
1186
|
+
def new_resolver_for_full_update
|
1187
|
+
new_resolver(unlocked_resolution_base)
|
1188
|
+
end
|
1189
|
+
|
1190
|
+
def unlocked_resolution_base
|
1191
|
+
new_resolution_base(last_resolve: SpecSet.new([]), unlock: true)
|
1192
|
+
end
|
1193
|
+
|
1194
|
+
def new_resolution_base(last_resolve:, unlock:)
|
1195
|
+
new_resolution_platforms = @current_platform_missing ? @new_platforms + [Bundler.local_platform] : @new_platforms
|
1196
|
+
Resolver::Base.new(source_requirements, expanded_dependencies, last_resolve, @platforms, locked_specs: @originally_locked_specs, unlock: unlock, prerelease: gem_version_promoter.pre?, prefer_local: @prefer_local, new_platforms: new_resolution_platforms)
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
def new_resolver(base)
|
1200
|
+
Resolver.new(base, gem_version_promoter, @most_specific_locked_platform)
|
1201
|
+
end
|
1185
1202
|
end
|
1186
1203
|
end
|
data/lib/bundler/dsl.rb
CHANGED
@@ -290,7 +290,7 @@ module Bundler
|
|
290
290
|
@dependencies.delete(current)
|
291
291
|
elsif dep.gemspec_dev_dep?
|
292
292
|
return
|
293
|
-
elsif current.source != dep.source
|
293
|
+
elsif current.source.to_s != dep.source.to_s
|
294
294
|
raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
|
295
295
|
"You specified that #{name} (#{dep.requirement}) should come from " \
|
296
296
|
"#{current.source || "an unspecified source"} and #{dep.source}\n"
|
data/lib/bundler/feature_flag.rb
CHANGED
@@ -30,7 +30,7 @@ module Bundler
|
|
30
30
|
settings_flag(:allow_offline_install) { bundler_4_mode? }
|
31
31
|
settings_flag(:cache_all) { bundler_4_mode? }
|
32
32
|
settings_flag(:forget_cli_options) { bundler_4_mode? }
|
33
|
-
settings_flag(:global_gem_cache) {
|
33
|
+
settings_flag(:global_gem_cache) { bundler_5_mode? }
|
34
34
|
settings_flag(:lockfile_checksums) { bundler_4_mode? }
|
35
35
|
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
|
36
36
|
settings_flag(:update_requires_all_flag) { bundler_5_mode? }
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with Ronn-NG/v0.10.1
|
2
2
|
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
|
3
|
-
.TH "BUNDLE\-BINSTUBS" "1" "
|
3
|
+
.TH "BUNDLE\-BINSTUBS" "1" "August 2025" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
|
6
6
|
.SH "SYNOPSIS"
|