bundler 2.4.14 → 2.4.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/lib/bundler/build_metadata.rb +2 -2
  4. data/lib/bundler/definition.rb +70 -37
  5. data/lib/bundler/lockfile_generator.rb +1 -1
  6. data/lib/bundler/man/bundle-add.1 +1 -1
  7. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  8. data/lib/bundler/man/bundle-cache.1 +1 -1
  9. data/lib/bundler/man/bundle-check.1 +1 -1
  10. data/lib/bundler/man/bundle-clean.1 +1 -1
  11. data/lib/bundler/man/bundle-config.1 +1 -1
  12. data/lib/bundler/man/bundle-console.1 +1 -1
  13. data/lib/bundler/man/bundle-doctor.1 +1 -1
  14. data/lib/bundler/man/bundle-exec.1 +1 -1
  15. data/lib/bundler/man/bundle-gem.1 +1 -1
  16. data/lib/bundler/man/bundle-help.1 +1 -1
  17. data/lib/bundler/man/bundle-info.1 +1 -1
  18. data/lib/bundler/man/bundle-init.1 +1 -1
  19. data/lib/bundler/man/bundle-inject.1 +1 -1
  20. data/lib/bundler/man/bundle-install.1 +1 -1
  21. data/lib/bundler/man/bundle-list.1 +1 -1
  22. data/lib/bundler/man/bundle-lock.1 +1 -1
  23. data/lib/bundler/man/bundle-open.1 +1 -1
  24. data/lib/bundler/man/bundle-outdated.1 +1 -1
  25. data/lib/bundler/man/bundle-platform.1 +1 -1
  26. data/lib/bundler/man/bundle-plugin.1 +1 -1
  27. data/lib/bundler/man/bundle-pristine.1 +1 -1
  28. data/lib/bundler/man/bundle-remove.1 +1 -1
  29. data/lib/bundler/man/bundle-show.1 +1 -1
  30. data/lib/bundler/man/bundle-update.1 +1 -1
  31. data/lib/bundler/man/bundle-version.1 +1 -1
  32. data/lib/bundler/man/bundle-viz.1 +1 -1
  33. data/lib/bundler/man/bundle.1 +1 -1
  34. data/lib/bundler/man/gemfile.5 +2 -2
  35. data/lib/bundler/man/gemfile.5.ronn +1 -1
  36. data/lib/bundler/resolver.rb +16 -2
  37. data/lib/bundler/runtime.rb +1 -1
  38. data/lib/bundler/source/git/git_proxy.rb +31 -13
  39. data/lib/bundler/source/git.rb +14 -1
  40. data/lib/bundler/source/rubygems.rb +1 -1
  41. data/lib/bundler/version.rb +1 -1
  42. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9946bc6a889915e914f12ec576748b58edfa7a41732d242dcd0ea72736bf0c54
4
- data.tar.gz: ac280b3666ae5967bee95dc98ee754d20efb52f390d0653b85cec9a38d3cae3f
3
+ metadata.gz: 6f9e9c83cf5645d84d7383ca3fdf70e8344283bfee08a8a197354ad3b9c20f63
4
+ data.tar.gz: 0630dce294ba12c3d357d339d21b703a24d71c946751c5598c001b955f2effea
5
5
  SHA512:
6
- metadata.gz: a8433864b6208eb1ce25b83d7dfac39b2745f906e2590d99b10d71de48dfb28cf028e7b6a7731289f534bfe2cbade1cc79cb1502096278f14ed67d70e21edcb2
7
- data.tar.gz: ec6c495bd7a6fdef3c7bb2ce703494c3aeebb3eb902fed8022c0ba22d72df746b38da610bfa0ea7598e1022963a44f13dbc16e3142a178762b235128063371f0
6
+ metadata.gz: c9e5534ed8dd3b86f9413363c5aec4a12c28a8ec0295b8ca0b2a2b10112b0e19ce95a8c369efe2d5faff856168aa47e37f8e44fa96c55fb04e5d449b456aa8a1
7
+ data.tar.gz: b5e4e73017ed9ac4461b2a346818f6cdd5824d0831be0a912af4a8318ed96578f69b58764072ace893230b0b5b7e61e4b200df779e68424e0c891fb5774ace68
data/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ # 2.4.16 (July 10, 2023)
2
+
3
+ ## Bug fixes:
4
+
5
+ - Exclude Bundler from missing locked dependencies check [#6792](https://github.com/rubygems/rubygems/pull/6792)
6
+ - Fix another incorrect removal of "ruby" platform from lockfile when changing path sources [#6784](https://github.com/rubygems/rubygems/pull/6784)
7
+ - Fix git source lockfile instability [#6786](https://github.com/rubygems/rubygems/pull/6786)
8
+
9
+ ## Documentation:
10
+
11
+ - `gemfile.5`: Code format the default glob to escape Markdown [#6790](https://github.com/rubygems/rubygems/pull/6790)
12
+
13
+ # 2.4.15 (June 29, 2023)
14
+
15
+ ## Enhancements:
16
+
17
+ - Improve edge case error message [#6733](https://github.com/rubygems/rubygems/pull/6733)
18
+
19
+ ## Bug fixes:
20
+
21
+ - Fix `bundle lock --update --bundler` [#6213](https://github.com/rubygems/rubygems/pull/6213)
22
+
1
23
  # 2.4.14 (June 12, 2023)
2
24
 
3
25
  ## Enhancements:
@@ -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 = "2023-06-12".freeze
8
- @git_commit_sha = "69f47cf53a".freeze
7
+ @built_at = "2023-07-10".freeze
8
+ @git_commit_sha = "bd573c7f8b".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -76,8 +76,11 @@ module Bundler
76
76
 
77
77
  @lockfile = lockfile
78
78
  @lockfile_contents = String.new
79
+
79
80
  @locked_bundler_version = nil
80
- @locked_ruby_version = nil
81
+ @resolved_bundler_version = nil
82
+
83
+ @locked_ruby_version = nil
81
84
  @new_platform = nil
82
85
  @removed_platform = nil
83
86
 
@@ -146,7 +149,7 @@ module Bundler
146
149
  @dependency_changes = converge_dependencies
147
150
  @local_changes = converge_locals
148
151
 
149
- @incomplete_lockfile = check_missing_lockfile_specs
152
+ @missing_lockfile_dep = check_missing_lockfile_dep
150
153
  end
151
154
 
152
155
  def gem_version_promoter
@@ -234,6 +237,14 @@ module Bundler
234
237
  end
235
238
 
236
239
  def current_dependencies
240
+ filter_relevant(dependencies)
241
+ end
242
+
243
+ def current_locked_dependencies
244
+ filter_relevant(locked_dependencies)
245
+ end
246
+
247
+ def filter_relevant(dependencies)
237
248
  dependencies.select do |d|
238
249
  d.should_include? && !d.gem_platforms([generic_local_platform]).empty?
239
250
  end
@@ -273,7 +284,7 @@ module Bundler
273
284
  @resolve ||= if Bundler.frozen_bundle?
274
285
  Bundler.ui.debug "Frozen, using resolution from the lockfile"
275
286
  @locked_specs
276
- elsif !unlocking? && nothing_changed?
287
+ elsif no_resolve_needed?
277
288
  if deleted_deps.any?
278
289
  Bundler.ui.debug "Some dependencies were deleted, using a subset of the resolution from the lockfile"
279
290
  SpecSet.new(filter_specs(@locked_specs, @dependencies - deleted_deps))
@@ -310,7 +321,7 @@ module Bundler
310
321
 
311
322
  if @locked_bundler_version
312
323
  locked_major = @locked_bundler_version.segments.first
313
- current_major = Bundler.gem_version.segments.first
324
+ current_major = bundler_version_to_lock.segments.first
314
325
 
315
326
  updating_major = locked_major < current_major
316
327
  end
@@ -350,25 +361,16 @@ module Bundler
350
361
  end
351
362
  end
352
363
 
364
+ def bundler_version_to_lock
365
+ @resolved_bundler_version || Bundler.gem_version
366
+ end
367
+
353
368
  def to_lock
354
369
  require_relative "lockfile_generator"
355
370
  LockfileGenerator.generate(self)
356
371
  end
357
372
 
358
373
  def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
359
- msg = String.new
360
- msg << "You are trying to install in deployment mode after changing\n" \
361
- "your Gemfile. Run `bundle install` elsewhere and add the\n" \
362
- "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
363
-
364
- unless explicit_flag
365
- suggested_command = unless Bundler.settings.locations("frozen").keys.include?(:env)
366
- "bundle config set frozen false"
367
- end
368
- msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
369
- "freeze \nby running `#{suggested_command}`." if suggested_command
370
- end
371
-
372
374
  added = []
373
375
  deleted = []
374
376
  changed = []
@@ -382,13 +384,8 @@ module Bundler
382
384
  deleted.concat deleted_deps.map {|d| "* #{pretty_dep(d)}" } if deleted_deps.any?
383
385
 
384
386
  both_sources = Hash.new {|h, k| h[k] = [] }
385
- @dependencies.each {|d| both_sources[d.name][0] = d }
386
-
387
- locked_dependencies.each do |d|
388
- next if !Bundler.feature_flag.bundler_3_mode? && @locked_specs[d.name].empty?
389
-
390
- both_sources[d.name][1] = d
391
- end
387
+ current_dependencies.each {|d| both_sources[d.name][0] = d }
388
+ current_locked_dependencies.each {|d| both_sources[d.name][1] = d }
392
389
 
393
390
  both_sources.each do |name, (dep, lock_dep)|
394
391
  next if dep.nil? || lock_dep.nil?
@@ -397,17 +394,26 @@ module Bundler
397
394
  lock_source = lock_dep.source || sources.default_source
398
395
  next if lock_source.include?(gemfile_source)
399
396
 
400
- gemfile_source_name = dep.source ? gemfile_source.identifier : "no specified source"
401
- lockfile_source_name = lock_dep.source ? lock_source.identifier : "no specified source"
397
+ gemfile_source_name = dep.source ? gemfile_source.to_gemfile : "no specified source"
398
+ lockfile_source_name = lock_dep.source ? lock_source.to_gemfile : "no specified source"
402
399
  changed << "* #{name} from `#{lockfile_source_name}` to `#{gemfile_source_name}`"
403
400
  end
404
401
 
405
402
  reason = change_reason
406
- msg << "\n\n#{reason.split(", ").map(&:capitalize).join("\n")}" unless reason.strip.empty?
403
+ msg = String.new
404
+ msg << "#{reason.capitalize.strip}, but the lockfile can't be updated because frozen mode is set"
407
405
  msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any?
408
406
  msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any?
409
407
  msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any?
410
- msg << "\n"
408
+ msg << "\n\nRun `bundle install` elsewhere and add the updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control.\n"
409
+
410
+ unless explicit_flag
411
+ suggested_command = unless Bundler.settings.locations("frozen").keys.include?(:env)
412
+ "bundle config set frozen false"
413
+ end
414
+ msg << "If this is a development machine, remove the #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} " \
415
+ "freeze by running `#{suggested_command}`." if suggested_command
416
+ end
411
417
 
412
418
  raise ProductionError, msg if added.any? || deleted.any? || changed.any? || !nothing_changed?
413
419
  end
@@ -472,7 +478,11 @@ module Bundler
472
478
  private :sources
473
479
 
474
480
  def nothing_changed?
475
- !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@incomplete_lockfile
481
+ !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@missing_lockfile_dep && !@unlocking_bundler
482
+ end
483
+
484
+ def no_resolve_needed?
485
+ !unlocking? && nothing_changed?
476
486
  end
477
487
 
478
488
  def unlocking?
@@ -486,7 +496,14 @@ module Bundler
486
496
  end
487
497
 
488
498
  def expanded_dependencies
489
- dependencies + metadata_dependencies
499
+ dependencies_with_bundler + metadata_dependencies
500
+ end
501
+
502
+ def dependencies_with_bundler
503
+ return dependencies unless @unlocking_bundler
504
+ return dependencies if dependencies.map(&:name).include?("bundler")
505
+
506
+ [Dependency.new("bundler", @unlocking_bundler)] + dependencies
490
507
  end
491
508
 
492
509
  def resolution_packages
@@ -552,6 +569,8 @@ module Bundler
552
569
  def start_resolution
553
570
  result = resolver.start
554
571
 
572
+ @resolved_bundler_version = result.find {|spec| spec.name == "bundler" }&.version
573
+
555
574
  SpecSet.new(SpecSet.new(result).for(dependencies, false, @platforms))
556
575
  end
557
576
 
@@ -609,7 +628,8 @@ module Bundler
609
628
  [@new_platform, "you added a new platform to your gemfile"],
610
629
  [@path_changes, "the gemspecs for path gems changed"],
611
630
  [@local_changes, "the gemspecs for git local gems changed"],
612
- [@incomplete_lockfile, "your lock file is missing some gems"],
631
+ [@missing_lockfile_dep, "your lock file is missing \"#{@missing_lockfile_dep}\""],
632
+ [@unlocking_bundler, "an update to the version of Bundler itself was requested"],
613
633
  ].select(&:first).map(&:last).join(", ")
614
634
  end
615
635
 
@@ -664,7 +684,7 @@ module Bundler
664
684
  !sources_with_changes.each {|source| @unlock[:sources] << source.name }.empty?
665
685
  end
666
686
 
667
- def check_missing_lockfile_specs
687
+ def check_missing_lockfile_dep
668
688
  all_locked_specs = @locked_specs.map(&:name) << "bundler"
669
689
 
670
690
  missing = @locked_specs.select do |s|
@@ -674,10 +694,14 @@ module Bundler
674
694
  if missing.any?
675
695
  @locked_specs.delete(missing)
676
696
 
677
- true
678
- else
679
- false
697
+ return missing.first.name
680
698
  end
699
+
700
+ return if @dependency_changes
701
+
702
+ current_dependencies.find do |d|
703
+ @locked_specs[d.name].empty? && d.name != "bundler"
704
+ end&.name
681
705
  end
682
706
 
683
707
  def converge_paths
@@ -861,8 +885,16 @@ module Bundler
861
885
  metadata_dependencies.each do |dep|
862
886
  source_requirements[dep.name] = sources.metadata_source
863
887
  end
864
- source_requirements[:default_bundler] = source_requirements["bundler"] || sources.default_source
865
- source_requirements["bundler"] = sources.metadata_source # needs to come last to override
888
+
889
+ default_bundler_source = source_requirements["bundler"] || sources.default_source
890
+
891
+ if @unlocking_bundler
892
+ default_bundler_source.add_dependency_names("bundler")
893
+ else
894
+ source_requirements[:default_bundler] = default_bundler_source
895
+ source_requirements["bundler"] = sources.metadata_source # needs to come last to override
896
+ end
897
+
866
898
  verify_changed_sources!
867
899
  source_requirements
868
900
  end
@@ -909,6 +941,7 @@ module Bundler
909
941
  Bundler.local_platform == Gem::Platform::RUBY ||
910
942
  !platforms.include?(Gem::Platform::RUBY) ||
911
943
  (@new_platform && platforms.last == Gem::Platform::RUBY) ||
944
+ @path_changes ||
912
945
  @dependency_changes ||
913
946
  !@originally_locked_specs.incomplete_ruby_specs?(dependencies)
914
947
 
@@ -71,7 +71,7 @@ module Bundler
71
71
  end
72
72
 
73
73
  def add_bundled_with
74
- add_section("BUNDLED WITH", Bundler::VERSION)
74
+ add_section("BUNDLED WITH", definition.bundler_version_to_lock.to_s)
75
75
  end
76
76
 
77
77
  def add_section(name, value)
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-ADD" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-ADD" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-BINSTUBS" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-BINSTUBS" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CACHE" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-CACHE" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CHECK" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-CHECK" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CLEAN" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-CLEAN" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONFIG" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-CONFIG" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-config\fR \- Set bundler configuration options
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONSOLE" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-CONSOLE" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-DOCTOR" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-EXEC" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-EXEC" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-GEM" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-GEM" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-HELP" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-HELP" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-help\fR \- Displays detailed help for each subcommand
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INFO" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-INFO" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INIT" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-INIT" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INJECT" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-INJECT" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INSTALL" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-INSTALL" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LIST" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-list\fR \- List all the gems in the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LOCK" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OPEN" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OUTDATED" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLATFORM" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-platform\fR \- Displays platform compatibility information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLUGIN" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-PLUGIN" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-plugin\fR \- Manage Bundler plugins
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PRISTINE" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-REMOVE" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-SHOW" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-UPDATE" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-update\fR \- Update your gems to the latest available versions
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VERSION" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-VERSION" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-version\fR \- Prints Bundler version information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VIZ" "1" "February 2023" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE" "1" "February 2023" "" ""
4
+ .TH "BUNDLE" "1" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\fR \- Ruby Dependency Management
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GEMFILE" "5" "February 2023" "" ""
4
+ .TH "GEMFILE" "5" "July 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -702,7 +702,7 @@ If you wish to use Bundler to help install dependencies for a gem while it is be
702
702
  The \fBgemspec\fR method adds any runtime dependencies as gem requirements in the default group\. It also adds development dependencies as gem requirements in the \fBdevelopment\fR group\. Finally, it adds a gem requirement on your project (\fBpath: \'\.\'\fR)\. In conjunction with \fBBundler\.setup\fR, this allows you to require project files in your test code as you would if the project were installed as a gem; you need not manipulate the load path manually or require project files via relative paths\.
703
703
  .
704
704
  .P
705
- 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: "{,\fI,\fR/*}\.gemspec"), what named \fB\.gemspec\fR it uses (if more than one is present), and which group development dependencies are included in\.
705
+ 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\.
706
706
  .
707
707
  .P
708
708
  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\.
@@ -514,7 +514,7 @@ paths.
514
514
 
515
515
  The `gemspec` method supports optional `:path`, `:glob`, `:name`, and `:development_group`
516
516
  options, which control where bundler looks for the `.gemspec`, the glob it uses to look
517
- for the gemspec (defaults to: "{,*,*/*}.gemspec"), what named `.gemspec` it uses
517
+ for the gemspec (defaults to: `{,*,*/*}.gemspec`), what named `.gemspec` it uses
518
518
  (if more than one is present), and which group development dependencies are included in.
519
519
 
520
520
  When a `gemspec` dependency encounters version conflicts during resolution, the
@@ -160,7 +160,7 @@ module Bundler
160
160
  constraint_string = constraint.constraint_string
161
161
  requirements = constraint_string.split(" OR ").map {|req| Gem::Requirement.new(req.split(",")) }
162
162
 
163
- if name == "bundler"
163
+ if name == "bundler" && bundler_pinned_to_current_version?
164
164
  custom_explanation = "the current Bundler version (#{Bundler::VERSION}) does not satisfy #{constraint}"
165
165
  extended_explanation = bundler_not_found_message(requirements)
166
166
  else
@@ -230,6 +230,12 @@ module Bundler
230
230
  def all_versions_for(package)
231
231
  name = package.name
232
232
  results = (@base[name] + filter_prereleases(@all_specs[name], package)).uniq {|spec| [spec.version.hash, spec.platform] }
233
+
234
+ if name == "bundler" && !bundler_pinned_to_current_version?
235
+ bundler_spec = Gem.loaded_specs["bundler"]
236
+ results << bundler_spec if bundler_spec
237
+ end
238
+
233
239
  locked_requirement = base_requirements[name]
234
240
  results = filter_matching_specs(results, locked_requirement) if locked_requirement
235
241
 
@@ -254,6 +260,14 @@ module Bundler
254
260
  @source_requirements[name] || @source_requirements[:default]
255
261
  end
256
262
 
263
+ def default_bundler_source
264
+ @source_requirements[:default_bundler]
265
+ end
266
+
267
+ def bundler_pinned_to_current_version?
268
+ !default_bundler_source.nil?
269
+ end
270
+
257
271
  def name_for_explicit_dependency_source
258
272
  Bundler.default_gemfile.basename.to_s
259
273
  rescue StandardError
@@ -398,7 +412,7 @@ module Bundler
398
412
  end
399
413
 
400
414
  def bundler_not_found_message(conflict_dependencies)
401
- candidate_specs = filter_matching_specs(source_for(:default_bundler).specs.search("bundler"), conflict_dependencies)
415
+ candidate_specs = filter_matching_specs(default_bundler_source.specs.search("bundler"), conflict_dependencies)
402
416
 
403
417
  if candidate_specs.any?
404
418
  target_version = candidate_specs.last.version
@@ -94,7 +94,7 @@ module Bundler
94
94
  definition_method :requires
95
95
 
96
96
  def lock(opts = {})
97
- return if @definition.nothing_changed? && !@definition.unlocking?
97
+ return if @definition.no_resolve_needed?
98
98
  @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections])
99
99
  end
100
100
 
@@ -67,8 +67,8 @@ module Bundler
67
67
  end
68
68
 
69
69
  def current_branch
70
- @current_branch ||= allowed_with_path do
71
- git("rev-parse", "--abbrev-ref", "HEAD", :dir => path).strip
70
+ @current_branch ||= with_path do
71
+ git_local("rev-parse", "--abbrev-ref", "HEAD", :dir => path).strip
72
72
  end
73
73
  end
74
74
 
@@ -84,7 +84,7 @@ module Bundler
84
84
  end
85
85
 
86
86
  def full_version
87
- @full_version ||= git("--version").sub(/git version\s*/, "").strip
87
+ @full_version ||= git_local("--version").sub(/git version\s*/, "").strip
88
88
  end
89
89
 
90
90
  def checkout
@@ -253,15 +253,15 @@ module Bundler
253
253
  end
254
254
 
255
255
  def git(*command, dir: nil)
256
- command_with_no_credentials = check_allowed(command)
257
-
258
- out, err, status = capture(command, dir)
259
-
260
- raise GitCommandError.new(command_with_no_credentials, dir || SharedHelpers.pwd, err) unless status.success?
261
-
262
- Bundler.ui.warn err unless err.empty?
256
+ run_command(*command, :dir => dir) do |unredacted_command|
257
+ check_allowed(unredacted_command)
258
+ end
259
+ end
263
260
 
264
- out
261
+ def git_local(*command, dir: nil)
262
+ run_command(*command, :dir => dir) do |unredacted_command|
263
+ redact_and_check_presence(unredacted_command)
264
+ end
265
265
  end
266
266
 
267
267
  def has_revision_cached?
@@ -330,12 +330,30 @@ module Bundler
330
330
  end
331
331
 
332
332
  def check_allowed(command)
333
- require "shellwords"
334
- command_with_no_credentials = URICredentialsFilter.credential_filtered_string("git #{command.shelljoin}", uri)
333
+ command_with_no_credentials = redact_and_check_presence(command)
335
334
  raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
336
335
  command_with_no_credentials
337
336
  end
338
337
 
338
+ def redact_and_check_presence(command)
339
+ raise GitNotInstalledError.new unless Bundler.git_present?
340
+
341
+ require "shellwords"
342
+ URICredentialsFilter.credential_filtered_string("git #{command.shelljoin}", uri)
343
+ end
344
+
345
+ def run_command(*command, dir: nil)
346
+ command_with_no_credentials = yield(command)
347
+
348
+ out, err, status = capture(command, dir)
349
+
350
+ raise GitCommandError.new(command_with_no_credentials, dir || SharedHelpers.pwd, err) unless status.success?
351
+
352
+ Bundler.ui.warn err unless err.empty?
353
+
354
+ out
355
+ end
356
+
339
357
  def capture(cmd, dir, ignore_err: false)
340
358
  SharedHelpers.with_clean_git_env do
341
359
  require "open3"
@@ -46,6 +46,14 @@ module Bundler
46
46
  out << " specs:\n"
47
47
  end
48
48
 
49
+ def to_gemfile
50
+ specifiers = %w[ref branch tag submodules glob].map do |opt|
51
+ "#{opt}: #{options[opt]}" if options[opt]
52
+ end
53
+
54
+ uri_with_specifiers(specifiers)
55
+ end
56
+
49
57
  def hash
50
58
  [self.class, uri, ref, branch, name, version, glob, submodules].hash
51
59
  end
@@ -80,7 +88,12 @@ module Bundler
80
88
  ""
81
89
  end
82
90
 
83
- specifiers = [rev, glob_for_display].compact
91
+ uri_with_specifiers([rev, glob_for_display])
92
+ end
93
+
94
+ def uri_with_specifiers(specifiers)
95
+ specifiers.compact!
96
+
84
97
  suffix =
85
98
  if specifiers.any?
86
99
  " (#{specifiers.join(", ")})"
@@ -123,6 +123,7 @@ module Bundler
123
123
  end
124
124
  end
125
125
  alias_method :name, :identifier
126
+ alias_method :to_gemfile, :identifier
126
127
 
127
128
  def specs
128
129
  @specs ||= begin
@@ -381,7 +382,6 @@ module Bundler
381
382
  idx = @allow_local ? installed_specs.dup : Index.new
382
383
 
383
384
  Dir["#{cache_path}/*.gem"].each do |gemfile|
384
- next if /^bundler\-[\d\.]+?\.gem/.match?(gemfile)
385
385
  s ||= Bundler.rubygems.spec_from_gem(gemfile)
386
386
  s.source = self
387
387
  idx << s
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.4.14".freeze
4
+ VERSION = "2.4.16".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
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: 2.4.14
4
+ version: 2.4.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -22,7 +22,7 @@ authors:
22
22
  autorequire:
23
23
  bindir: exe
24
24
  cert_chain: []
25
- date: 2023-06-12 00:00:00.000000000 Z
25
+ date: 2023-07-10 00:00:00.000000000 Z
26
26
  dependencies: []
27
27
  description: Bundler manages an application's dependencies through its entire life,
28
28
  across many machines, systematically and repeatably
@@ -381,7 +381,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
381
  - !ruby/object:Gem::Version
382
382
  version: 3.0.1
383
383
  requirements: []
384
- rubygems_version: 3.4.14
384
+ rubygems_version: 3.4.16
385
385
  signing_key:
386
386
  specification_version: 4
387
387
  summary: The best way to manage your application's dependencies