bundler 4.0.17 → 4.0.19

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +45 -0
  3. data/lib/bundler/build_metadata.rb +1 -1
  4. data/lib/bundler/cli/check.rb +1 -3
  5. data/lib/bundler/cli/common.rb +11 -0
  6. data/lib/bundler/cli/install.rb +1 -0
  7. data/lib/bundler/cli/issue.rb +2 -2
  8. data/lib/bundler/cli/lock.rb +10 -2
  9. data/lib/bundler/cli/update.rb +1 -0
  10. data/lib/bundler/cli.rb +5 -3
  11. data/lib/bundler/compact_index_client/cache.rb +11 -0
  12. data/lib/bundler/definition.rb +13 -3
  13. data/lib/bundler/endpoint_specification.rb +19 -1
  14. data/lib/bundler/fetcher.rb +7 -1
  15. data/lib/bundler/installer/parallel_installer.rb +9 -1
  16. data/lib/bundler/installer.rb +6 -0
  17. data/lib/bundler/lockfile_generator.rb +16 -0
  18. data/lib/bundler/man/bundle-add.1 +1 -1
  19. data/lib/bundler/man/bundle-add.1.ronn +1 -1
  20. data/lib/bundler/man/bundle-cache.1 +3 -0
  21. data/lib/bundler/man/bundle-cache.1.ronn +6 -0
  22. data/lib/bundler/man/bundle-config.1 +3 -3
  23. data/lib/bundler/man/bundle-config.1.ronn +7 -5
  24. data/lib/bundler/man/bundle-console.1 +2 -2
  25. data/lib/bundler/man/bundle-console.1.ronn +2 -2
  26. data/lib/bundler/man/bundle-init.1 +1 -1
  27. data/lib/bundler/man/bundle-init.1.ronn +1 -1
  28. data/lib/bundler/man/bundle-lock.1 +4 -1
  29. data/lib/bundler/man/bundle-lock.1.ronn +6 -0
  30. data/lib/bundler/man/bundle-plugin.1 +1 -1
  31. data/lib/bundler/man/bundle-plugin.1.ronn +1 -1
  32. data/lib/bundler/man/bundle.1 +22 -1
  33. data/lib/bundler/man/bundle.1.ronn +22 -1
  34. data/lib/bundler/man/gemfile.5 +12 -1
  35. data/lib/bundler/man/gemfile.5.ronn +20 -1
  36. data/lib/bundler/resolver.rb +54 -1
  37. data/lib/bundler/source/git/git_proxy.rb +6 -5
  38. data/lib/bundler/source_list.rb +30 -1
  39. data/lib/bundler/version.rb +1 -1
  40. data/lib/bundler.rb +1 -1
  41. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0e51552827f6a9e6f69879c84b28b5fc102157385d7b5acc8f76ccf23fc1d02
4
- data.tar.gz: 580c4732a5106f1ac54652b7399e187a365a6b891e6b1eb5093093b7c0bcbbbd
3
+ metadata.gz: b226f9f760a2d66f3b95d374178f56adb909e5cf3ffd2dc11c7605b2e87dba70
4
+ data.tar.gz: 86e4c8a419331c322df10fa720ad136270b195de3550bd98760aae42d825f6c2
5
5
  SHA512:
6
- metadata.gz: 03f0b65a2e6655251ddd488cfe43983e7e94d1e72be6166ab5c4627f6075ee9d4aabf38e7e6c4514eb906a0ee524aaa6a3fbf2a598fdb7ecc8f3301b803cdf90
7
- data.tar.gz: 36b037826c24cf525249954629c83c3d131a27a3d009d0a9af749e1108dcd043c151fa7f4f5786edc47a75c5526af6917a7da8ed0b222766e97749a4d298bbfd
6
+ metadata.gz: 27f08e16ceebc01eb1d884c5307b55d993c5048184c4eb2cc3df91596f384b1f23cf038f3b95119bbf0b89aee8f2cad2b380ddf5f8bd0500470fc1a04f882e70
7
+ data.tar.gz: 4aaac6eb994de8d3fe9d3305168cea18e2eecd31802681bb548f70cd4ebebcf996d5edb85a61f090cdb05447f57dd074c113872da11831072c07a0c9cc4341e6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.19 / 2026-08-20
4
+
5
+ ### Enhancements:
6
+
7
+ * Validate the platform field in Gem::Installer#verify_spec. Pull request [#9780](https://github.com/ruby/rubygems/pull/9780) by hsbt
8
+ * Restrict UserDefined handling to explicit class set for Gem::SafeMashal. Pull request [#9770](https://github.com/ruby/rubygems/pull/9770) by jackorp
9
+ * Filter git command output against the configured URI. Pull request [#9778](https://github.com/ruby/rubygems/pull/9778) by hsbt
10
+ * Summarize cooldown-skipped versions at the end of install, update, and lock. Pull request [#9762](https://github.com/ruby/rubygems/pull/9762) by hsbt
11
+
12
+ ### Bug fixes:
13
+
14
+ * Make repeated bundle lock options accumulate. Pull request [#9748](https://github.com/ruby/rubygems/pull/9748) by hsbt
15
+ * Fail instead of warning when frozen mode can't update the lockfile. Pull request [#9750](https://github.com/ruby/rubygems/pull/9750) by hsbt
16
+ * Fix wrong $LOAD_PATH for gems installed in the same process. Pull request [#9784](https://github.com/ruby/rubygems/pull/9784) by hsbt
17
+
18
+ ### Documentation:
19
+
20
+ * Fix auto-clean default version in bundle config docs. Pull request [#9783](https://github.com/ruby/rubygems/pull/9783) by hsbt
21
+ * Correct Bundler 5 default path documentation. Pull request [#9771](https://github.com/ruby/rubygems/pull/9771) by alloutflo
22
+
23
+ ## 4.0.18 / 2026-08-05
24
+
25
+ ### Enhancements:
26
+
27
+ * Don't mask install errors when no Gemfile can be located. Pull request [#9757](https://github.com/ruby/rubygems/pull/9757) by hsbt
28
+ * Warn when duplicate source declarations conflict on cooldown. Pull request [#9736](https://github.com/ruby/rubygems/pull/9736) by hsbt
29
+ * Redact URI userinfo from settings names in Bundler User-Agent. Pull request [#9716](https://github.com/ruby/rubygems/pull/9716) by hsbt
30
+ * Validate gem name before building compact index cache paths. Pull request [#9717](https://github.com/ruby/rubygems/pull/9717) by hsbt
31
+
32
+ ### Bug fixes:
33
+
34
+ * Fail `bundle check` when frozen mode needs lockfile changes. Pull request [#9715](https://github.com/ruby/rubygems/pull/9715) by hsbt
35
+ * Skip empty checksum values in compact index metadata. Pull request [#9713](https://github.com/ruby/rubygems/pull/9713) by hsbt
36
+
37
+ ### Security:
38
+
39
+ * Add --cooldown flag to bundle lock and bundle cache. Pull request [#9725](https://github.com/ruby/rubygems/pull/9725) by hsbt
40
+
41
+ ### Documentation:
42
+
43
+ * Point bundler.io URLs at guides.rubygems.org. Pull request [#9737](https://github.com/ruby/rubygems/pull/9737) by hsbt
44
+ * Document Bundler checksum behavior for default gems. Pull request [#9735](https://github.com/ruby/rubygems/pull/9735) by p-linnane
45
+ * List missing subcommands in bundle(1) UTILITIES section. Pull request [#9721](https://github.com/ruby/rubygems/pull/9721) by hsbt
46
+ * Document pessimistic operator and eval_gemfile in gemfile(5). Pull request [#9719](https://github.com/ruby/rubygems/pull/9719) by hsbt
47
+
3
48
  ## 4.0.17 / 2026-07-22
4
49
 
5
50
  ### Enhancements:
@@ -5,7 +5,7 @@ module Bundler
5
5
  module BuildMetadata
6
6
  # begin ivars
7
7
  @built_at = nil
8
- @git_commit_sha = "f80cbc4c44".freeze
8
+ @git_commit_sha = "2d0e3df43a".freeze
9
9
  # end ivars
10
10
 
11
11
  # A hash representation of the build metadata.
@@ -12,6 +12,7 @@ module Bundler
12
12
  Bundler.settings.set_command_option_if_given :path, options[:path]
13
13
 
14
14
  definition = Bundler.definition
15
+ definition.ensure_equivalent_gemfile_and_lockfile
15
16
  definition.validate_runtime!
16
17
 
17
18
  begin
@@ -28,9 +29,6 @@ module Bundler
28
29
  not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" }
29
30
  Bundler.ui.warn "Install missing gems with `bundle install`"
30
31
  exit 1
31
- elsif !Bundler.default_lockfile.file? && Bundler.frozen_bundle?
32
- Bundler.ui.error "This bundle has been frozen, but there is no #{SharedHelpers.relative_lockfile_path} present"
33
- exit 1
34
32
  else
35
33
  definition.lock(true) unless options[:"dry-run"]
36
34
  Bundler.ui.info "The Gemfile's dependencies are satisfied"
@@ -20,6 +20,17 @@ module Bundler
20
20
  Bundler.ui.info msg
21
21
  end
22
22
 
23
+ def self.output_cooldown_skipped_summary(definition = Bundler.definition)
24
+ skipped = definition.cooldown_skipped
25
+ return if skipped.empty?
26
+
27
+ Bundler.ui.info "The following gem versions were skipped by the cooldown setting:"
28
+ skipped.each do |entry|
29
+ days = entry[:available_in_days]
30
+ Bundler.ui.info " * #{entry[:name]} #{entry[:version]} (available in #{days} #{days == 1 ? "day" : "days"}), resolved #{entry[:resolved]} instead"
31
+ end
32
+ end
33
+
23
34
  def self.output_fund_metadata_summary
24
35
  return if Bundler.settings["ignore_funding_requests"]
25
36
  definition = Bundler.definition
@@ -64,6 +64,7 @@ module Bundler
64
64
  end
65
65
 
66
66
  Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
67
+ Bundler::CLI::Common.output_cooldown_skipped_summary(definition)
67
68
 
68
69
  if CLI::Common.clean_after_install?
69
70
  require_relative "clean"
@@ -13,10 +13,10 @@ module Bundler
13
13
  https://github.com/ruby/rubygems/blob/master/doc/bundler/TROUBLESHOOTING.md
14
14
 
15
15
  2. Instructions for common Bundler uses can be found on the documentation
16
- site: https://bundler.io/
16
+ site: https://guides.rubygems.org/
17
17
 
18
18
  3. Information about each Bundler command can be found in the Bundler
19
- man pages: https://bundler.io/man/bundle.1.html
19
+ man pages: https://guides.rubygems.org/command-reference/bundle/
20
20
 
21
21
  Hopefully the troubleshooting steps above resolved your problem! If things
22
22
  still aren't working the way you expect them to, please let us know so
@@ -16,6 +16,9 @@ module Bundler
16
16
 
17
17
  check_for_conflicting_options
18
18
 
19
+ Bundler::CLI::Common.validate_cooldown!(options[:cooldown])
20
+ Bundler.settings.set_command_option_if_given :cooldown, options[:cooldown]
21
+
19
22
  print = options[:print]
20
23
  previous_output_stream = Bundler.ui.output_stream
21
24
  Bundler.ui.output_stream = :stderr if print
@@ -23,6 +26,9 @@ module Bundler
23
26
  Bundler::Fetcher.disable_endpoint = options["full-index"]
24
27
 
25
28
  update = options[:update]
29
+ # --update is repeatable, so it parses as an array with one entry per
30
+ # occurrence, where a bare `--update` produces a `true` entry
31
+ update = update.include?(true) ? true : update.flatten if update.is_a?(Array)
26
32
  conservative = options[:conservative]
27
33
  bundler = options[:bundler]
28
34
 
@@ -41,12 +47,12 @@ module Bundler
41
47
 
42
48
  Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
43
49
 
44
- options["remove-platform"].each do |platform_string|
50
+ options["remove-platform"].flatten.each do |platform_string|
45
51
  platform = Gem::Platform.new(platform_string)
46
52
  definition.remove_platform(platform)
47
53
  end
48
54
 
49
- options["add-platform"].each do |platform_string|
55
+ options["add-platform"].flatten.each do |platform_string|
50
56
  platform = Gem::Platform.new(platform_string)
51
57
  if platform.to_s == "unknown"
52
58
  Bundler.ui.error "The platform `#{platform_string}` is unknown to RubyGems and can't be added to the lockfile."
@@ -74,6 +80,8 @@ module Bundler
74
80
  puts "Writing lockfile to #{file}"
75
81
  definition.write_lock(file, false)
76
82
  end
83
+
84
+ Bundler::CLI::Common.output_cooldown_skipped_summary(definition)
77
85
  end
78
86
 
79
87
  Bundler.ui.output_stream = previous_output_stream
@@ -118,6 +118,7 @@ module Bundler
118
118
  Bundler.ui.confirm "Bundle updated!"
119
119
  Bundler::CLI::Common.output_without_groups_message(:update)
120
120
  Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
121
+ Bundler::CLI::Common.output_cooldown_skipped_summary
121
122
 
122
123
  Bundler::CLI::Common.output_fund_metadata_summary
123
124
  end
data/lib/bundler/cli.rb CHANGED
@@ -461,6 +461,7 @@ module Bundler
461
461
  method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)."
462
462
  method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
463
463
  method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install (removed)"
464
+ method_option "cooldown", type: :numeric, banner: "Only consider gem versions published at least N days ago. Use 0 to disable."
464
465
  long_desc <<-D
465
466
  The cache command will copy the .gem files for every gem in the bundle into the
466
467
  directory ./vendor/cache. If you then check that directory into your source
@@ -625,15 +626,15 @@ module Bundler
625
626
  end
626
627
 
627
628
  desc "lock", "Creates a lockfile without installing"
628
- method_option "update", type: :array, lazy_default: true, banner: "ignore the existing lockfile, update all gems by default, or update list of given gems"
629
+ method_option "update", type: :array, lazy_default: true, repeatable: true, banner: "ignore the existing lockfile, update all gems by default, or update list of given gems"
629
630
  method_option "local", type: :boolean, default: false, banner: "do not attempt to fetch remote gemspecs and use the local gem cache only"
630
631
  method_option "print", type: :boolean, default: false, banner: "print the lockfile to STDOUT instead of writing to the file system"
631
632
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
632
633
  method_option "lockfile", type: :string, default: nil, banner: "the path the lockfile should be written to"
633
634
  method_option "full-index", type: :boolean, default: false, banner: "Fall back to using the single-file index of all gems"
634
635
  method_option "add-checksums", type: :boolean, default: false, banner: "Adds checksums to the lockfile"
635
- method_option "add-platform", type: :array, default: [], banner: "Add a new platform to the lockfile"
636
- method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
636
+ method_option "add-platform", type: :array, default: [], repeatable: true, banner: "Add a new platform to the lockfile"
637
+ method_option "remove-platform", type: :array, default: [], repeatable: true, banner: "Remove a platform from the lockfile"
637
638
  method_option "normalize-platforms", type: :boolean, default: false, banner: "Normalize lockfile platforms"
638
639
  method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
639
640
  method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
@@ -642,6 +643,7 @@ module Bundler
642
643
  method_option "strict", type: :boolean, banner: "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
643
644
  method_option "conservative", type: :boolean, banner: "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
644
645
  method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
646
+ method_option "cooldown", type: :numeric, banner: "Only consider gem versions published at least N days ago. Use 0 to disable."
645
647
  def lock
646
648
  require_relative "cli/lock"
647
649
  Lock.new(options).run
@@ -50,6 +50,7 @@ module Bundler
50
50
 
51
51
  def info_path(name)
52
52
  name = name.to_s
53
+ validate_name!(name)
53
54
  # TODO: converge this into the info_root by hashing all filenames like info_etag_path
54
55
  if /[^a-z0-9_-]/.match?(name)
55
56
  name += "-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}"
@@ -61,9 +62,19 @@ module Bundler
61
62
 
62
63
  def info_etag_path(name)
63
64
  name = name.to_s
65
+ validate_name!(name)
64
66
  @info_etag_root.join("#{name}-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}")
65
67
  end
66
68
 
69
+ # Gem names come from the remote index and are not otherwise
70
+ # validated, so refuse anything that would escape the cache
71
+ # directory when used as a path component.
72
+ def validate_name!(name)
73
+ return if File.basename(name) == name
74
+
75
+ raise SecurityError, "malformed gem name: #{name.inspect}"
76
+ end
77
+
67
78
  def mkdir(name)
68
79
  directory.join(name).tap do |dir|
69
80
  SharedHelpers.filesystem_access(dir) do
@@ -366,6 +366,12 @@ module Bundler
366
366
  sources.git_sources.filter_map {|s| File.realpath(s.path) if File.exist?(s.path) }
367
367
  end
368
368
 
369
+ # Versions excluded by cooldown during the last resolution, one entry per
370
+ # gem with the newest skipped version. Empty when no resolution ran.
371
+ def cooldown_skipped
372
+ @cooldown_skipped || []
373
+ end
374
+
369
375
  def groups
370
376
  dependencies.flat_map(&:groups).uniq
371
377
  end
@@ -404,7 +410,7 @@ module Bundler
404
410
  updating_major = locked_major < current_major
405
411
  end
406
412
 
407
- preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
413
+ preserve_unknown_sections ||= Bundler.frozen_bundle? || (!updating_major && !(unlocking? || @unlocking_bundler))
408
414
 
409
415
  if File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
410
416
  return if Bundler.frozen_bundle?
@@ -413,8 +419,10 @@ module Bundler
413
419
  end
414
420
 
415
421
  if Bundler.frozen_bundle?
416
- Bundler.ui.error "Cannot write a changed lockfile while frozen."
417
- return
422
+ msg = lockfile_changes_summary("frozen mode is set") ||
423
+ "Your lockfile needs to be updated, but it can't be because frozen mode is set.\n\n" \
424
+ "Run `bundle install` elsewhere and add the updated #{SharedHelpers.relative_lockfile_path} to version control."
425
+ raise ProductionError, msg
418
426
  end
419
427
 
420
428
  # Convert to \r\n if the existing lock has them, i.e., Windows with
@@ -770,6 +778,8 @@ module Bundler
770
778
 
771
779
  result = SpecSet.new(resolver.start)
772
780
 
781
+ @cooldown_skipped = resolver.cooldown_skipped
782
+
773
783
  @resolved_bundler_version = result.find {|spec| spec.name == "bundler" }&.version
774
784
 
775
785
  @new_platforms.each do |platform|
@@ -50,6 +50,19 @@ module Bundler
50
50
  end
51
51
  end
52
52
 
53
+ # `require_paths` is overridden above, but `full_require_paths` (and so
54
+ # `load_paths`) is computed from `raw_require_paths`, which would otherwise
55
+ # report the default `lib` for every gem
56
+ def raw_require_paths
57
+ if @remote_specification
58
+ @remote_specification.raw_require_paths
59
+ elsif _local_specification
60
+ _local_specification.raw_require_paths
61
+ else
62
+ super
63
+ end
64
+ end
65
+
53
66
  # needed for inline
54
67
  def load_paths
55
68
  # remote specs aren't installed, and can't have load_paths
@@ -153,8 +166,13 @@ module Bundler
153
166
  next unless v
154
167
  case k.to_s
155
168
  when "checksum"
169
+ # Some registries send empty checksum values, treat them as if the
170
+ # checksum was not included at all
171
+ checksum = v.last
172
+ next unless checksum
173
+
156
174
  begin
157
- @checksum = Checksum.from_api(v.last, @spec_fetcher.uri)
175
+ @checksum = Checksum.from_api(checksum, @spec_fetcher.uri)
158
176
  rescue ArgumentError => e
159
177
  raise ArgumentError, "Invalid checksum for #{full_name}: #{e.message}"
160
178
  end
@@ -215,7 +215,13 @@ module Bundler
215
215
  agent << " #{ruby.engine}/#{ruby.versions_string(engine_version)}"
216
216
  end
217
217
 
218
- agent << " options/#{Bundler.settings.all.join(",")}"
218
+ # Some settings keys embed a URI (e.g. `mirror.<uri>`) whose userinfo can
219
+ # carry credentials. Strip the userinfo before advertising the setting
220
+ # names so we don't leak secrets to every gem source we talk to.
221
+ options = Bundler.settings.all.map do |key|
222
+ key.include?("://") ? key.gsub(%r{//[^/@]+@}, "//") : key
223
+ end
224
+ agent << " options/#{options.join(",")}"
219
225
 
220
226
  agent << " ci/#{cis.join(",")}" if cis.any?
221
227
 
@@ -255,7 +255,15 @@ module Bundler
255
255
 
256
256
  def require_tree_for_spec(spec)
257
257
  tree = @spec_set.what_required(spec)
258
- t = String.new("In #{File.basename(SharedHelpers.default_gemfile)}:\n")
258
+ gemfile_name = begin
259
+ File.basename(SharedHelpers.default_gemfile)
260
+ rescue GemfileNotFound
261
+ # This runs while reporting an install error. When no Gemfile can be
262
+ # located (e.g. Bundler used as a library), raising here would mask
263
+ # the original error, so fall back to a generic header instead.
264
+ "Gemfile"
265
+ end
266
+ t = String.new("In #{gemfile_name}:\n")
259
267
  tree.each_with_index do |s, depth|
260
268
  t << " " * depth.succ << s.name
261
269
  unless tree.last == s
@@ -83,6 +83,12 @@ module Bundler
83
83
  install(options)
84
84
 
85
85
  Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
86
+ # Drop the source caches too, since releasing resolution memory dropped
87
+ # the source indexes. A resolution happening after this point would
88
+ # otherwise rebuild them around a snapshot of installed gems taken
89
+ # before the install, and materialize against remote specs that don't
90
+ # know where the gems they stand for ended up.
91
+ @definition.sources.clear_cache
86
92
 
87
93
  lock
88
94
  Standalone.new(options[:standalone], @definition).generate if options[:standalone]
@@ -103,6 +103,11 @@ module Bundler
103
103
  end
104
104
 
105
105
  def bundler_checksum
106
+ # In frozen mode the lockfile can't change, so reproduce whatever bundler
107
+ # entry is already locked instead of recording one for the running bundler
108
+ # version, which may legitimately differ from the locked one.
109
+ return locked_bundler_checksum if Bundler.frozen_bundle?
110
+
106
111
  # `.dev` versions and `SKIP_BUNDLER_CHECKSUM` are deliberate opt-outs (used
107
112
  # by Bundler/RubyGems' own development and release tasks): never record a
108
113
  # checksum for Bundler itself in those cases.
@@ -138,5 +143,16 @@ module Bundler
138
143
 
139
144
  locked_gems.bundler_version != definition.bundler_version_to_lock
140
145
  end
146
+
147
+ def locked_bundler_checksum
148
+ locked_version = definition.locked_gems&.bundler_version
149
+ return [] unless locked_version
150
+
151
+ metadata_source = definition.sources.metadata_source
152
+ locked_spec = LazySpecification.new("bundler", locked_version, Gem::Platform::RUBY, metadata_source)
153
+ return [] if metadata_source.checksum_store.missing?(locked_spec)
154
+
155
+ [metadata_source.checksum_store.to_lock(locked_spec)]
156
+ end
141
157
  end
142
158
  end
@@ -76,4 +76,4 @@ You can assign the gem to more than one group\.
76
76
  \fBbundle add rails \-\-group "development, test"\fR
77
77
  .IP "" 0
78
78
  .SH "SEE ALSO"
79
- Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR, bundle\-remove(1) \fIbundle\-remove\.1\.html\fR
79
+ Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR, bundle\-remove(1) \fIbundle\-remove\.1\.html\fR
@@ -88,5 +88,5 @@ Adds the named gem to the [`Gemfile(5)`][Gemfile(5)] and run `bundle install`.
88
88
 
89
89
  ## SEE ALSO
90
90
 
91
- [Gemfile(5)](https://bundler.io/man/gemfile.5.html),
91
+ [Gemfile(5)](https://guides.rubygems.org/gemfile/),
92
92
  [bundle-remove(1)](bundle-remove.1.html)
@@ -17,6 +17,9 @@ Include gems for all platforms present in the lockfile, not only the current one
17
17
  \fB\-\-cache\-path=CACHE\-PATH\fR
18
18
  Specify a different cache path than the default (vendor/cache)\.
19
19
  .TP
20
+ \fB\-\-cooldown=<number>\fR
21
+ Only consider gem versions published at least \fInumber\fR days ago when resolving before caching\. Pass \fB0\fR to disable cooldown for this run, overriding any per\-source or global configuration\. See \fBcooldown\fR in bundle\-config(1)\.
22
+ .TP
20
23
  \fB\-\-gemfile=GEMFILE\fR
21
24
  Use the specified gemfile instead of Gemfile\.
22
25
  .TP
@@ -21,6 +21,12 @@ use the gems in the cache in preference to the ones on `rubygems.org`.
21
21
  * `--cache-path=CACHE-PATH`:
22
22
  Specify a different cache path than the default (vendor/cache).
23
23
 
24
+ * `--cooldown=<number>`:
25
+ Only consider gem versions published at least <number> days ago when
26
+ resolving before caching. Pass `0` to disable cooldown for this run,
27
+ overriding any per-source or global configuration. See `cooldown` in
28
+ bundle-config(1).
29
+
24
30
  * `--gemfile=GEMFILE`:
25
31
  Use the specified gemfile instead of Gemfile.
26
32
 
@@ -82,7 +82,7 @@ The following is a list of all configuration keys and their purpose\. You can le
82
82
  .IP "\(bu" 4
83
83
  \fBcache_path\fR (\fBBUNDLE_CACHE_PATH\fR): The directory that bundler will place cached gems in when running \fBbundle package\fR, and that bundler will look in when installing gems\. Defaults to \fBvendor/cache\fR\.
84
84
  .IP "\(bu" 4
85
- \fBclean\fR (\fBBUNDLE_CLEAN\fR): Whether Bundler should run \fBbundle clean\fR automatically after \fBbundle install\fR\. Defaults to \fBtrue\fR in Bundler 4, as long as \fBpath\fR is not explicitly configured\.
85
+ \fBclean\fR (\fBBUNDLE_CLEAN\fR): Whether Bundler should run \fBbundle clean\fR automatically after \fBbundle install\fR\. Defaults to \fBtrue\fR in Bundler 5, as long as \fBpath\fR is not explicitly configured\.
86
86
  .IP "\(bu" 4
87
87
  \fBconsole\fR (\fBBUNDLE_CONSOLE\fR): The console that \fBbundle console\fR starts\. Defaults to \fBirb\fR\.
88
88
  .IP "\(bu" 4
@@ -139,7 +139,7 @@ Cooldown filtering depends on the gem server providing a per\-version \fBcreated
139
139
  .IP "\(bu" 4
140
140
  \fBlockfile\fR (\fBBUNDLE_LOCKFILE\fR): The path to the lockfile that bundler should use\. By default, Bundler adds \fB\.lock\fR to the end of the \fBgemfile\fR entry\. Can be set to \fBfalse\fR in the Gemfile to disable lockfile creation entirely (see gemfile(5))\.
141
141
  .IP "\(bu" 4
142
- \fBlockfile_checksums\fR (\fBBUNDLE_LOCKFILE_CHECKSUMS\fR): Whether Bundler should include a checksums section in new lockfiles, to protect from compromised gem sources\. Defaults to true\.
142
+ \fBlockfile_checksums\fR (\fBBUNDLE_LOCKFILE_CHECKSUMS\fR): Whether Bundler should include a checksums section in new lockfiles, to protect from compromised gem sources\. Defaults to true\. Bundler's own checksum is only included when its \fB\.gem\fR file is cached, which may not be the case when Bundler is installed as a default gem\.
143
143
  .IP "\(bu" 4
144
144
  \fBno_install\fR (\fBBUNDLE_NO_INSTALL\fR): Whether \fBbundle package\fR should skip installing gems\.
145
145
  .IP "\(bu" 4
@@ -147,7 +147,7 @@ Cooldown filtering depends on the gem server providing a per\-version \fBcreated
147
147
  .IP "\(bu" 4
148
148
  \fBonly\fR (\fBBUNDLE_ONLY\fR): A space\-separated list of groups to install only gems of the specified groups\. Please check carefully if you want to install also gems without a group, because they get put inside \fBdefault\fR group\. For example \fBonly test:default\fR will install all gems specified in test group and without one\.
149
149
  .IP "\(bu" 4
150
- \fBpath\fR (\fBBUNDLE_PATH\fR): The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. When not set, Bundler install by default to a \fB\.bundle\fR directory relative to repository root in Bundler 4, and to the default system path (\fBGem\.dir\fR) before Bundler 4\. That means that before Bundler 4, Bundler shares this location with Rubygems, and \fBgem install \|\.\|\.\|\.\fR will have gems installed in the same location and therefore, gems installed without \fBpath\fR set will show up by calling \fBgem list\fR\. This will not be the case in Bundler 4\.
150
+ \fBpath\fR (\fBBUNDLE_PATH\fR): The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. When not set, Bundler install by default to a \fB\.bundle\fR directory relative to repository root in Bundler 5, and to the default system path (\fBGem\.dir\fR) before Bundler 5\. That means that before Bundler 5, Bundler shares this location with Rubygems, and \fBgem install \|\.\|\.\|\.\fR will have gems installed in the same location and therefore, gems installed without \fBpath\fR set will show up by calling \fBgem list\fR\. This will not be the case in Bundler 5\.
151
151
  .IP "\(bu" 4
152
152
  \fBpath\.system\fR (\fBBUNDLE_PATH__SYSTEM\fR): Whether Bundler will install gems into the default system path (\fBGem\.dir\fR)\.
153
153
  .IP "\(bu" 4
@@ -133,7 +133,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
133
133
  Defaults to `vendor/cache`.
134
134
  * `clean` (`BUNDLE_CLEAN`):
135
135
  Whether Bundler should run `bundle clean` automatically after
136
- `bundle install`. Defaults to `true` in Bundler 4, as long as `path` is not
136
+ `bundle install`. Defaults to `true` in Bundler 5, as long as `path` is not
137
137
  explicitly configured.
138
138
  * `console` (`BUNDLE_CONSOLE`):
139
139
  The console that `bundle console` starts. Defaults to `irb`.
@@ -230,6 +230,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
230
230
  Gemfile to disable lockfile creation entirely (see gemfile(5)).
231
231
  * `lockfile_checksums` (`BUNDLE_LOCKFILE_CHECKSUMS`):
232
232
  Whether Bundler should include a checksums section in new lockfiles, to protect from compromised gem sources. Defaults to true.
233
+ Bundler's own checksum is only included when its `.gem` file is cached, which
234
+ may not be the case when Bundler is installed as a default gem.
233
235
  * `no_install` (`BUNDLE_NO_INSTALL`):
234
236
  Whether `bundle package` should skip installing gems.
235
237
  * `no_prune` (`BUNDLE_NO_PRUNE`):
@@ -243,12 +245,12 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
243
245
  The location on disk where all gems in your bundle will be located regardless
244
246
  of `$GEM_HOME` or `$GEM_PATH` values. Bundle gems not found in this location
245
247
  will be installed by `bundle install`. When not set, Bundler install by
246
- default to a `.bundle` directory relative to repository root in Bundler 4,
247
- and to the default system path (`Gem.dir`) before Bundler 4. That means that
248
- before Bundler 4, Bundler shares this location with Rubygems, and `gem
248
+ default to a `.bundle` directory relative to repository root in Bundler 5,
249
+ and to the default system path (`Gem.dir`) before Bundler 5. That means that
250
+ before Bundler 5, Bundler shares this location with Rubygems, and `gem
249
251
  install ...` will have gems installed in the same location and therefore,
250
252
  gems installed without `path` set will show up by calling `gem list`. This
251
- will not be the case in Bundler 4.
253
+ will not be the case in Bundler 5.
252
254
  * `path.system` (`BUNDLE_PATH__SYSTEM`):
253
255
  Whether Bundler will install gems into the default system path (`Gem.dir`).
254
256
  * `plugins` (`BUNDLE_PLUGINS`):
@@ -8,7 +8,7 @@
8
8
  .SH "DESCRIPTION"
9
9
  Starts an interactive Ruby console session in the context of the current bundle\.
10
10
  .P
11
- If no \fBGROUP\fR is specified, all gems in the \fBdefault\fR group in the Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR are preliminarily loaded\.
11
+ If no \fBGROUP\fR is specified, all gems in the \fBdefault\fR group in the Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR are preliminarily loaded\.
12
12
  .P
13
13
  If \fBGROUP\fR is specified, all gems in the given group in the Gemfile in addition to the gems in \fBdefault\fR group are loaded\. Even if the given group does not exist in the Gemfile, IRB console starts without any warning or error\.
14
14
  .P
@@ -30,4 +30,4 @@ Resolving dependencies\|\.\|\.\|\.
30
30
  [1] pry(main)>
31
31
  .fi
32
32
  .SH "SEE ALSO"
33
- Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR
33
+ Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR
@@ -9,7 +9,7 @@ bundle-console(1) -- Open an IRB session with the bundle pre-loaded
9
9
 
10
10
  Starts an interactive Ruby console session in the context of the current bundle.
11
11
 
12
- If no `GROUP` is specified, all gems in the `default` group in the [Gemfile(5)](https://bundler.io/man/gemfile.5.html) are
12
+ If no `GROUP` is specified, all gems in the `default` group in the [Gemfile(5)](https://guides.rubygems.org/gemfile/) are
13
13
  preliminarily loaded.
14
14
 
15
15
  If `GROUP` is specified, all gems in the given group in the Gemfile in addition
@@ -36,4 +36,4 @@ the shell from the following:
36
36
 
37
37
  ## SEE ALSO
38
38
 
39
- [Gemfile(5)](https://bundler.io/man/gemfile.5.html)
39
+ [Gemfile(5)](https://guides.rubygems.org/gemfile/)
@@ -17,4 +17,4 @@ Use the specified name for the gemfile instead of \fBGemfile\fR
17
17
  .SH "FILES"
18
18
  Included in the default [\fBGemfile(5)\fR][Gemfile(5)] generated is the line \fB# frozen_string_literal: true\fR\. This is a magic comment supported for the first time in Ruby 2\.3\. The presence of this line results in all string literals in the file being implicitly frozen\.
19
19
  .SH "SEE ALSO"
20
- Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR
20
+ Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR
@@ -29,4 +29,4 @@ results in all string literals in the file being implicitly frozen.
29
29
 
30
30
  ## SEE ALSO
31
31
 
32
- [Gemfile(5)](https://bundler.io/man/gemfile.5.html)
32
+ [Gemfile(5)](https://guides.rubygems.org/gemfile/)
@@ -4,7 +4,7 @@
4
4
  .SH "NAME"
5
5
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
6
6
  .SH "SYNOPSIS"
7
- \fBbundle lock\fR [\-\-update] [\-\-bundler[=BUNDLER]] [\-\-local] [\-\-print] [\-\-lockfile=PATH] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-add\-checksums] [\-\-add\-platform] [\-\-remove\-platform] [\-\-normalize\-platforms] [\-\-patch] [\-\-minor] [\-\-major] [\-\-pre] [\-\-strict] [\-\-conservative]
7
+ \fBbundle lock\fR [\-\-update] [\-\-bundler[=BUNDLER]] [\-\-local] [\-\-print] [\-\-lockfile=PATH] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-add\-checksums] [\-\-add\-platform] [\-\-remove\-platform] [\-\-normalize\-platforms] [\-\-patch] [\-\-minor] [\-\-major] [\-\-pre] [\-\-strict] [\-\-conservative] [\-\-cooldown=NUMBER]
8
8
  .SH "DESCRIPTION"
9
9
  Lock the gems specified in Gemfile\.
10
10
  .SH "OPTIONS"
@@ -59,6 +59,9 @@ If updating, do not allow any gem to be updated past latest \-\-patch | \-\-mino
59
59
  .TP
60
60
  \fB\-\-conservative\fR
61
61
  If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated\.
62
+ .TP
63
+ \fB\-\-cooldown=<number>\fR
64
+ Only consider gem versions published at least \fInumber\fR days ago when resolving\. Pass \fB0\fR to disable cooldown for this run, overriding any per\-source or global configuration\. See \fBcooldown\fR in bundle\-config(1)\.
62
65
  .SH "UPDATING ALL GEMS"
63
66
  If you run \fBbundle lock\fR with \fB\-\-update\fR option without list of gems, bundler will ignore any previously installed gems and resolve all dependencies again based on the latest versions of all gems available in the sources\.
64
67
  .SH "UPDATING A LIST OF GEMS"
@@ -20,6 +20,7 @@ bundle-lock(1) -- Creates / Updates a lockfile without installing
20
20
  [--pre]
21
21
  [--strict]
22
22
  [--conservative]
23
+ [--cooldown=NUMBER]
23
24
 
24
25
  ## DESCRIPTION
25
26
 
@@ -84,6 +85,11 @@ Lock the gems specified in Gemfile.
84
85
  * `--conservative`:
85
86
  If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated.
86
87
 
88
+ * `--cooldown=<number>`:
89
+ Only consider gem versions published at least <number> days ago when
90
+ resolving. Pass `0` to disable cooldown for this run, overriding any
91
+ per-source or global configuration. See `cooldown` in bundle-config(1).
92
+
87
93
  ## UPDATING ALL GEMS
88
94
 
89
95
  If you run `bundle lock` with `--update` option without list of gems, bundler will
@@ -71,6 +71,6 @@ Describe subcommands or one specific subcommand\.
71
71
  No options\.
72
72
  .SH "SEE ALSO"
73
73
  .IP "\(bu" 4
74
- How to write a Bundler plugin \fIhttps://bundler\.io/guides/bundler_plugins\.html\fR
74
+ How to write a Bundler plugin \fIhttps://guides\.rubygems\.org/bundler_plugins/\fR
75
75
  .IP "" 0
76
76
 
@@ -81,4 +81,4 @@ No options.
81
81
 
82
82
  ## SEE ALSO
83
83
 
84
- * [How to write a Bundler plugin](https://bundler.io/guides/bundler_plugins.html)
84
+ * [How to write a Bundler plugin](https://guides.rubygems.org/bundler_plugins/)
@@ -8,7 +8,7 @@
8
8
  .SH "DESCRIPTION"
9
9
  Bundler manages an \fBapplication's dependencies\fR through its entire life across many machines systematically and repeatably\.
10
10
  .P
11
- See the bundler website \fIhttps://bundler\.io\fR for information on getting started, and Gemfile(5) for more information on the \fBGemfile\fR format\.
11
+ See the RubyGems guides \fIhttps://guides\.rubygems\.org/\fR for information on getting started, and Gemfile(5) for more information on the \fBGemfile\fR format\.
12
12
  .SH "OPTIONS"
13
13
  .TP
14
14
  \fB\-\-no\-color\fR
@@ -54,6 +54,18 @@ Determine whether the requirements for your application are installed and availa
54
54
  \fBbundle show(1)\fR \fIbundle\-show\.1\.html\fR
55
55
  Show the source location of a particular gem in the bundle
56
56
  .TP
57
+ \fBbundle info(1)\fR \fIbundle\-info\.1\.html\fR
58
+ Show information for the given gem in your bundle
59
+ .TP
60
+ \fBbundle list(1)\fR \fIbundle\-list\.1\.html\fR
61
+ List all the gems in the bundle
62
+ .TP
63
+ \fBbundle licenses(1)\fR \fIbundle\-licenses\.1\.html\fR
64
+ Print the license of all gems in the bundle
65
+ .TP
66
+ \fBbundle fund(1)\fR \fIbundle\-fund\.1\.html\fR
67
+ Lists information about gems seeking funding assistance
68
+ .TP
57
69
  \fBbundle outdated(1)\fR \fIbundle\-outdated\.1\.html\fR
58
70
  Show all of the outdated gems in the current bundle
59
71
  .TP
@@ -78,9 +90,18 @@ Display platform compatibility information
78
90
  \fBbundle clean(1)\fR \fIbundle\-clean\.1\.html\fR
79
91
  Clean up unused gems in your Bundler directory
80
92
  .TP
93
+ \fBbundle pristine(1)\fR \fIbundle\-pristine\.1\.html\fR
94
+ Restores installed gems to their pristine condition
95
+ .TP
81
96
  \fBbundle doctor(1)\fR \fIbundle\-doctor\.1\.html\fR
82
97
  Display warnings about common problems
83
98
  .TP
99
+ \fBbundle env(1)\fR \fIbundle\-env\.1\.html\fR
100
+ Print information about the environment Bundler is running under
101
+ .TP
102
+ \fBbundle issue(1)\fR \fIbundle\-issue\.1\.html\fR
103
+ Get help reporting Bundler issues
104
+ .TP
84
105
  \fBbundle remove(1)\fR \fIbundle\-remove\.1\.html\fR
85
106
  Removes gems from the Gemfile
86
107
  .TP
@@ -10,7 +10,7 @@ bundle(1) -- Ruby Dependency Management
10
10
  Bundler manages an `application's dependencies` through its entire life
11
11
  across many machines systematically and repeatably.
12
12
 
13
- See [the bundler website](https://bundler.io) for information on getting
13
+ See [the RubyGems guides](https://guides.rubygems.org/) for information on getting
14
14
  started, and Gemfile(5) for more information on the `Gemfile` format.
15
15
 
16
16
  ## OPTIONS
@@ -64,6 +64,18 @@ We divide `bundle` subcommands into primary commands and utilities:
64
64
  * [`bundle show(1)`](bundle-show.1.html):
65
65
  Show the source location of a particular gem in the bundle
66
66
 
67
+ * [`bundle info(1)`](bundle-info.1.html):
68
+ Show information for the given gem in your bundle
69
+
70
+ * [`bundle list(1)`](bundle-list.1.html):
71
+ List all the gems in the bundle
72
+
73
+ * [`bundle licenses(1)`](bundle-licenses.1.html):
74
+ Print the license of all gems in the bundle
75
+
76
+ * [`bundle fund(1)`](bundle-fund.1.html):
77
+ Lists information about gems seeking funding assistance
78
+
67
79
  * [`bundle outdated(1)`](bundle-outdated.1.html):
68
80
  Show all of the outdated gems in the current bundle
69
81
 
@@ -88,9 +100,18 @@ We divide `bundle` subcommands into primary commands and utilities:
88
100
  * [`bundle clean(1)`](bundle-clean.1.html):
89
101
  Clean up unused gems in your Bundler directory
90
102
 
103
+ * [`bundle pristine(1)`](bundle-pristine.1.html):
104
+ Restores installed gems to their pristine condition
105
+
91
106
  * [`bundle doctor(1)`](bundle-doctor.1.html):
92
107
  Display warnings about common problems
93
108
 
109
+ * [`bundle env(1)`](bundle-env.1.html):
110
+ Print information about the environment Bundler is running under
111
+
112
+ * [`bundle issue(1)`](bundle-issue.1.html):
113
+ Get help reporting Bundler issues
114
+
94
115
  * [`bundle remove(1)`](bundle-remove.1.html):
95
116
  Removes gems from the Gemfile
96
117
 
@@ -107,6 +107,8 @@ gem "nokogiri", ">= 1\.4\.2"
107
107
  gem "RedCloth", ">= 4\.1\.0", "< 4\.2\.0"
108
108
  .fi
109
109
  .IP "" 0
110
+ .P
111
+ Most version specifiers, like \fB>= 1\.0\fR, are self\-explanatory\. The pessimistic specifier \fB~>\fR constrains both a lower and an upper bound: \fB~> 2\.0\.3\fR is identical to \fB>= 2\.0\.3\fR and \fB< 2\.1\fR, and \fB~> 2\.1\fR is identical to \fB>= 2\.1\fR and \fB< 3\.0\fR\. A pessimistic specifier with a prerelease component, like \fB~> 2\.2\.beta\fR, will match prerelease versions like \fB2\.2\.beta\.12\fR\. \fB~> 0\fR is identical to \fB>= 0\.0\fR and \fB< 1\.0\fR\.
110
112
  .SS "REQUIRE AS"
111
113
  Each \fIgem\fR \fBMAY\fR specify files that should be used when autorequiring via \fBBundler\.require\fR\. You may pass an array with multiple files or \fBtrue\fR if the file you want \fBrequired\fR has the same name as \fIgem\fR or \fBfalse\fR to prevent any file from being autorequired\.
112
114
  .IP "" 4
@@ -164,7 +166,7 @@ bundle config set \-\-local without development test
164
166
  .P
165
167
  Also, calling \fBBundler\.setup\fR with no parameters, or calling \fBrequire "bundler/setup"\fR will setup all groups except for the ones you excluded via \fB\-\-without\fR (since they are not available)\.
166
168
  .P
167
- Note that on \fBbundle install\fR, bundler downloads and evaluates all gems, in order to create a single canonical list of all of the required gems and their dependencies\. This means that you cannot list different versions of the same gems in different groups\. For more details, see Understanding Bundler \fIhttps://bundler\.io/rationale\.html\fR\.
169
+ Note that on \fBbundle install\fR, bundler downloads and evaluates all gems, in order to create a single canonical list of all of the required gems and their dependencies\. This means that you cannot list different versions of the same gems in different groups\. For more details, see Dependency management \fIhttps://guides\.rubygems\.org/dependency_management/\fR\.
168
170
  .SS "PLATFORMS"
169
171
  If a gem should only be used in a particular platform or set of platforms, you can specify them\. Platforms are essentially identical to groups, except that you do not need to use the \fB\-\-without\fR install\-time flag to exclude groups of gems for other platforms\.
170
172
  .P
@@ -460,6 +462,15 @@ The \fBgemspec\fR method adds any runtime dependencies as gem requirements in th
460
462
  The \fBgemspec\fR method supports optional \fB:path\fR, \fB:glob\fR, \fB:name\fR, and \fB:development_group\fR options, which control where bundler looks for the \fB\.gemspec\fR, the glob it uses to look for the gemspec (defaults to: \fB{,*,*/*}\.gemspec\fR), what named \fB\.gemspec\fR it uses (if more than one is present), and which group development dependencies are included in\.
461
463
  .P
462
464
  When a \fBgemspec\fR dependency encounters version conflicts during resolution, the local version under development will always be selected \-\- even if there are remote versions that better match other requirements for the \fBgemspec\fR gem\.
465
+ .SH "EVAL_GEMFILE"
466
+ A Gemfile \fBMAY\fR be split across multiple files\. The \fBeval_gemfile\fR method reads the contents of another file as if they appeared in the current Gemfile\. A relative path is resolved against the directory of the file containing the call\.
467
+ .IP "" 4
468
+ .nf
469
+ eval_gemfile "another\.gemfile"
470
+ .fi
471
+ .IP "" 0
472
+ .P
473
+ This can be useful to run tests against multiple combinations of dependencies, or to load per\-developer gems from an untracked gemfile\.
463
474
  .SH "SOURCE PRIORITY"
464
475
  When attempting to locate a gem to satisfy a gem requirement, bundler uses the following priority order:
465
476
  .IP "1." 4
@@ -137,6 +137,13 @@ Each _gem_ `MAY` have one or more version specifiers.
137
137
  gem "nokogiri", ">= 1.4.2"
138
138
  gem "RedCloth", ">= 4.1.0", "< 4.2.0"
139
139
 
140
+ Most version specifiers, like `>= 1.0`, are self-explanatory. The pessimistic
141
+ specifier `~>` constrains both a lower and an upper bound: `~> 2.0.3` is
142
+ identical to `>= 2.0.3` and `< 2.1`, and `~> 2.1` is identical to `>= 2.1` and
143
+ `< 3.0`. A pessimistic specifier with a prerelease component, like
144
+ `~> 2.2.beta`, will match prerelease versions like `2.2.beta.12`. `~> 0` is
145
+ identical to `>= 0.0` and `< 1.0`.
146
+
140
147
  ### REQUIRE AS
141
148
 
142
149
  Each _gem_ `MAY` specify files that should be used when autorequiring via
@@ -193,7 +200,7 @@ are not available).
193
200
  Note that on `bundle install`, bundler downloads and evaluates all gems, in order to
194
201
  create a single canonical list of all of the required gems and their dependencies.
195
202
  This means that you cannot list different versions of the same gems in different
196
- groups. For more details, see [Understanding Bundler](https://bundler.io/rationale.html).
203
+ groups. For more details, see [Dependency management](https://guides.rubygems.org/dependency_management/).
197
204
 
198
205
  ### PLATFORMS
199
206
 
@@ -541,6 +548,18 @@ When a `gemspec` dependency encounters version conflicts during resolution, the
541
548
  local version under development will always be selected -- even if there are
542
549
  remote versions that better match other requirements for the `gemspec` gem.
543
550
 
551
+ ## EVAL_GEMFILE
552
+
553
+ A Gemfile `MAY` be split across multiple files. The `eval_gemfile` method reads
554
+ the contents of another file as if they appeared in the current Gemfile. A
555
+ relative path is resolved against the directory of the file containing the
556
+ call.
557
+
558
+ eval_gemfile "another.gemfile"
559
+
560
+ This can be useful to run tests against multiple combinations of dependencies,
561
+ or to load per-developer gems from an untracked gemfile.
562
+
544
563
  ## SOURCE PRIORITY
545
564
 
546
565
  When attempting to locate a gem to satisfy a gem requirement,
@@ -14,11 +14,15 @@ module Bundler
14
14
  require_relative "resolver/root"
15
15
  require_relative "resolver/strategy"
16
16
 
17
+ attr_reader :cooldown_skipped
18
+
17
19
  def initialize(base, gem_version_promoter, most_specific_locked_platform = nil)
18
20
  @source_requirements = base.source_requirements
19
21
  @base = base
20
22
  @gem_version_promoter = gem_version_promoter
21
23
  @most_specific_locked_platform = most_specific_locked_platform
24
+ @cooldown_skipped = []
25
+ @cooldown_skipped_specs = {}
22
26
  end
23
27
 
24
28
  def start
@@ -36,6 +40,8 @@ module Bundler
36
40
  root = Resolver::Root.new(name_for_explicit_dependency_source)
37
41
  root_version = Resolver::Candidate.new(0)
38
42
 
43
+ @cooldown_skipped_specs = {}
44
+
39
45
  @all_specs = Hash.new do |specs, name|
40
46
  source = source_for(name)
41
47
  matches = source.specs.search(name)
@@ -80,7 +86,9 @@ module Bundler
80
86
  solver = PubGrub::VersionSolver.new(source: self, root: root, strategy: Strategy.new(self), logger: logger)
81
87
  result = solver.solve
82
88
  resolved_specs = result.flat_map {|package, version| version.to_specs(package, @most_specific_locked_platform) }
83
- SpecSet.new(resolved_specs).specs_with_additional_variants_from(@base.locked_specs)
89
+ spec_set = SpecSet.new(resolved_specs).specs_with_additional_variants_from(@base.locked_specs)
90
+ @cooldown_skipped = cooldown_skipped_summary(spec_set)
91
+ spec_set
84
92
  rescue PubGrub::SolveFailure => e
85
93
  incompatibility = e.incompatibility
86
94
 
@@ -424,6 +432,7 @@ module Bundler
424
432
  specs.each do |spec|
425
433
  next unless cooldown_excluded?(spec)
426
434
  excluded[[spec.name, spec.version]] = true
435
+ (@cooldown_skipped_specs ||= {})[[spec.name, spec.version]] ||= spec
427
436
  end
428
437
  excluded
429
438
  end
@@ -466,6 +475,50 @@ module Bundler
466
475
  @cooldown_now ||= Time.now
467
476
  end
468
477
 
478
+ # Reports, per gem, the newest version that cooldown kept out of a
479
+ # successful resolution. A skipped version is only worth reporting when it
480
+ # is newer than the resolved version and satisfies every requirement the
481
+ # final resolution places on that gem, so we don't claim a version the
482
+ # resolver could never have picked anyway.
483
+ def cooldown_skipped_summary(spec_set)
484
+ return [] if @cooldown_skipped_specs.empty?
485
+
486
+ requirements = Hash.new {|h, name| h[name] = [] }
487
+ @requirements.each {|dep| requirements[dep.name] << dep.requirement }
488
+ spec_set.each do |spec|
489
+ spec.dependencies.each {|dep| requirements[dep.name] << dep.requirement }
490
+ end
491
+
492
+ resolved_versions = {}
493
+ spec_set.each do |spec|
494
+ version = resolved_versions[spec.name]
495
+ resolved_versions[spec.name] = spec.version if version.nil? || spec.version > version
496
+ end
497
+
498
+ newest_skipped = {}
499
+ @cooldown_skipped_specs.each do |(name, version), spec|
500
+ resolved = resolved_versions[name]
501
+ next unless resolved && version > resolved
502
+ next unless requirements[name].all? {|req| req.satisfied_by?(version) }
503
+ newest = newest_skipped[name]
504
+ newest_skipped[name] = spec if newest.nil? || version > newest.version
505
+ end
506
+
507
+ newest_skipped.values.sort_by(&:name).map do |spec|
508
+ {
509
+ name: spec.name,
510
+ version: spec.version,
511
+ resolved: resolved_versions[spec.name],
512
+ available_in_days: remaining_cooldown_days(spec),
513
+ }
514
+ end
515
+ end
516
+
517
+ def remaining_cooldown_days(spec)
518
+ remaining = (spec.remote.effective_cooldown * 86_400) - (cooldown_now - spec.created_at)
519
+ [(remaining / 86_400.0).ceil, 1].max
520
+ end
521
+
469
522
  def filter_remote_specs(specs, package)
470
523
  if package.prefer_local?
471
524
  local_specs = specs.select {|s| s.is_a?(StubSpecification) }
@@ -364,9 +364,10 @@ module Bundler
364
364
  git("rev-parse", "--verify", reference, dir: path).strip
365
365
  end
366
366
 
367
- # Adds credentials to the URI
367
+ # Adds credentials to the URI. This is the URI given to git, so it's
368
+ # also the one command output must be filtered against.
368
369
  def configured_uri
369
- if /https?:/.match?(uri)
370
+ @configured_uri ||= if /https?:/.match?(uri)
370
371
  remote = Gem::URI(uri)
371
372
  config_auth = Bundler.settings[remote.to_s] || Bundler.settings[remote.host]
372
373
  remote.userinfo ||= config_auth
@@ -409,7 +410,7 @@ module Bundler
409
410
  raise GitNotInstalledError.new unless Bundler.git_present?
410
411
 
411
412
  require "shellwords"
412
- URICredentialsFilter.credential_filtered_string("git #{command.shelljoin}", uri)
413
+ URICredentialsFilter.credential_filtered_string("git #{command.shelljoin}", configured_uri)
413
414
  end
414
415
 
415
416
  def run_command(*command, dir: nil)
@@ -429,10 +430,10 @@ module Bundler
429
430
  require "open3"
430
431
  out, err, status = Open3.capture3(*capture3_args_for(cmd, dir))
431
432
 
432
- filtered_out = URICredentialsFilter.credential_filtered_string(out, uri)
433
+ filtered_out = URICredentialsFilter.credential_filtered_string(out, configured_uri)
433
434
  return [filtered_out, status] if ignore_err
434
435
 
435
- filtered_err = URICredentialsFilter.credential_filtered_string(err, uri)
436
+ filtered_err = URICredentialsFilter.credential_filtered_string(err, configured_uri)
436
437
  [filtered_out, filtered_err, status]
437
438
  end
438
439
  end
@@ -50,7 +50,13 @@ module Bundler
50
50
 
51
51
  def add_rubygems_source(options = {})
52
52
  new_source = Source::Rubygems.new(options)
53
- return @global_rubygems_source if @global_rubygems_source == new_source
53
+ if @global_rubygems_source == new_source
54
+ warn_on_cooldown_conflict(new_source, @global_rubygems_source)
55
+ return @global_rubygems_source
56
+ end
57
+
58
+ existing_source = @rubygems_sources.find {|s| s == new_source }
59
+ warn_on_cooldown_conflict(new_source, existing_source) if existing_source
54
60
 
55
61
  add_source_to_list new_source, @rubygems_sources
56
62
  end
@@ -60,6 +66,13 @@ module Bundler
60
66
  end
61
67
 
62
68
  def add_global_rubygems_remote(uri, cooldown: nil)
69
+ unless cooldown.nil?
70
+ new_source = source_class.new("remotes" => uri, "cooldown" => cooldown)
71
+ [global_rubygems_source, *@rubygems_sources].find do |existing_source|
72
+ warn_on_cooldown_conflict(new_source, existing_source)
73
+ end
74
+ end
75
+
63
76
  global_rubygems_source.add_remote(uri, cooldown: cooldown)
64
77
  global_rubygems_source
65
78
  end
@@ -222,6 +235,22 @@ module Bundler
222
235
  end
223
236
  end
224
237
 
238
+ def warn_on_cooldown_conflict(new_source, existing_source)
239
+ new_source.remote_cooldowns.any? do |uri, cooldown|
240
+ next false unless existing_source.remotes.include?(uri)
241
+
242
+ existing_cooldown = existing_source.cooldown_for(uri)
243
+ next false if existing_cooldown == cooldown
244
+
245
+ previous = existing_cooldown ? "`cooldown: #{existing_cooldown}`" : "no cooldown"
246
+ Bundler.ui.warn "The source #{uri} is declared more than once with different cooldown " \
247
+ "values (`cooldown: #{cooldown}` here, #{previous} previously). All declarations of " \
248
+ "the same source URL share a single cooldown, so only one of these values will apply " \
249
+ "to all gems from this source."
250
+ true
251
+ end
252
+ end
253
+
225
254
  def warn_on_git_protocol(source)
226
255
  return if Bundler.settings["git.allow_insecure"]
227
256
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "4.0.17".freeze
4
+ VERSION = "4.0.19".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= gem_version.segments.first
data/lib/bundler.rb CHANGED
@@ -26,7 +26,7 @@ require_relative "bundler/build_metadata"
26
26
  # or Bundler.setup to setup environment where only specified gems and their
27
27
  # specified versions could be used.
28
28
  #
29
- # See {Bundler website}[https://bundler.io/docs.html] for extensive documentation
29
+ # See {Bundler documentation}[https://guides.rubygems.org/command-reference/bundle/] for extensive documentation
30
30
  # on gemfiles creation and Bundler usage.
31
31
  #
32
32
  # As a standard library inside project, Bundler could be used for introspection
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.17
4
+ version: 4.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -401,7 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
401
401
  - !ruby/object:Gem::Version
402
402
  version: 3.4.1
403
403
  requirements: []
404
- rubygems_version: 4.0.16
404
+ rubygems_version: 3.6.9
405
405
  specification_version: 4
406
406
  summary: The best way to manage your application's dependencies
407
407
  test_files: []