bundler 2.5.9 → 2.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/lib/bundler/build_metadata.rb +2 -2
  4. data/lib/bundler/cli.rb +5 -22
  5. data/lib/bundler/definition.rb +57 -28
  6. data/lib/bundler/dependency.rb +2 -1
  7. data/lib/bundler/environment_preserver.rb +2 -20
  8. data/lib/bundler/injector.rb +2 -1
  9. data/lib/bundler/man/bundle-add.1 +1 -1
  10. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  11. data/lib/bundler/man/bundle-cache.1 +1 -1
  12. data/lib/bundler/man/bundle-check.1 +3 -1
  13. data/lib/bundler/man/bundle-check.1.ronn +3 -0
  14. data/lib/bundler/man/bundle-clean.1 +1 -1
  15. data/lib/bundler/man/bundle-config.1 +1 -3
  16. data/lib/bundler/man/bundle-config.1.ronn +0 -3
  17. data/lib/bundler/man/bundle-console.1 +1 -1
  18. data/lib/bundler/man/bundle-doctor.1 +1 -1
  19. data/lib/bundler/man/bundle-exec.1 +1 -1
  20. data/lib/bundler/man/bundle-gem.1 +1 -1
  21. data/lib/bundler/man/bundle-help.1 +1 -1
  22. data/lib/bundler/man/bundle-info.1 +1 -1
  23. data/lib/bundler/man/bundle-init.1 +1 -1
  24. data/lib/bundler/man/bundle-inject.1 +1 -1
  25. data/lib/bundler/man/bundle-install.1 +1 -1
  26. data/lib/bundler/man/bundle-list.1 +1 -1
  27. data/lib/bundler/man/bundle-lock.1 +1 -1
  28. data/lib/bundler/man/bundle-open.1 +1 -1
  29. data/lib/bundler/man/bundle-outdated.1 +1 -1
  30. data/lib/bundler/man/bundle-platform.1 +1 -1
  31. data/lib/bundler/man/bundle-plugin.1 +1 -1
  32. data/lib/bundler/man/bundle-pristine.1 +1 -1
  33. data/lib/bundler/man/bundle-remove.1 +1 -1
  34. data/lib/bundler/man/bundle-show.1 +1 -1
  35. data/lib/bundler/man/bundle-update.1 +1 -1
  36. data/lib/bundler/man/bundle-version.1 +1 -1
  37. data/lib/bundler/man/bundle-viz.1 +1 -1
  38. data/lib/bundler/man/bundle.1 +1 -1
  39. data/lib/bundler/man/gemfile.5 +1 -1
  40. data/lib/bundler/rubygems_ext.rb +12 -0
  41. data/lib/bundler/settings.rb +0 -1
  42. data/lib/bundler/setup.rb +3 -0
  43. data/lib/bundler/source/rubygems.rb +3 -16
  44. data/lib/bundler/source_list.rb +15 -2
  45. data/lib/bundler/spec_set.rb +1 -1
  46. data/lib/bundler/version.rb +1 -1
  47. data/lib/bundler.rb +20 -0
  48. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b343f681293b03c25fbc82c8d4c323154aec1af8dc5f34e619779c7f4d4c634b
4
- data.tar.gz: 0566537e3cc941f3160e5060c806f0418907cca56e8d0e56a5b79dbb7d9bd94f
3
+ metadata.gz: f2695a15d38685b993a09dcf7eb0acc5d52c61ea0259a5467b161bd5fd7a7ce6
4
+ data.tar.gz: 794b454b5687c3cd0851daf45d355326cd8eaddce8abfc46e3e01f8cdbed87ad
5
5
  SHA512:
6
- metadata.gz: 2effd5a50b198e6113853e8d695bcc98d396f6bc0d036e55756a7615755fa8f7498fbab09f7b51d13aef5fe0c2acd1de807c16f7446c5a188de18f7793ebab4b
7
- data.tar.gz: 8cdafdd6dbe2da1aa03e44717211fc88440974c03c2057f57ecf514c5b9253d1aa7f1e9994758bcfb5ba614435b0853d070dfe32bfd25a7a033f45b03db86ca2
6
+ metadata.gz: eb611d6aed04553214e7304d6b3775cc64e34f5eb7e251c67d3e2e80fffb117681b322bbbaf759e58c942675b95c47d934f27ed715bd63b2ae4542a52c0a4ab5
7
+ data.tar.gz: b5482313980b8e1e3dd3477b21e16248b009dd22ff54c519cd2f7328b2031689a18c724eb6c6fe26d441c532bb38bd18e0d91bd256f72f05ebac77067f9e8ac6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # 2.5.10 (May 3, 2024)
2
+
3
+ ## Security:
4
+
5
+ - Never write credentials to lockfiles [#7560](https://github.com/rubygems/rubygems/pull/7560)
6
+
7
+ ## Enhancements:
8
+
9
+ - Add auto_install support to require "bundler/setup" [#6561](https://github.com/rubygems/rubygems/pull/6561)
10
+ - Add `--glob` flag to `bundle add` [#7557](https://github.com/rubygems/rubygems/pull/7557)
11
+
12
+ ## Bug fixes:
13
+
14
+ - Make sure `bundle update <specific_gems>` can always update to the latest resolvable version of each requested gem [#7558](https://github.com/rubygems/rubygems/pull/7558)
15
+ - Show better error when installed gemspecs are unreadable [#7603](https://github.com/rubygems/rubygems/pull/7603)
16
+ - Fix `bundle update` not working on an out of sync lockfile [#7607](https://github.com/rubygems/rubygems/pull/7607)
17
+ - Don't upcase Windows ENV before backing it up [#7574](https://github.com/rubygems/rubygems/pull/7574)
18
+ - Properly resolve aliases when `bundle help` is run [#7601](https://github.com/rubygems/rubygems/pull/7601)
19
+ - Fix issue installing gems with linux-musl variant on non musl linux [#7583](https://github.com/rubygems/rubygems/pull/7583)
20
+
21
+ ## Documentation:
22
+
23
+ - Clarify `bundle check` behaviour in docs [#7613](https://github.com/rubygems/rubygems/pull/7613)
24
+
1
25
  # 2.5.9 (April 12, 2024)
2
26
 
3
27
  ## Bug fixes:
@@ -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 = "2024-04-12".freeze
8
- @git_commit_sha = "4304697e0c".freeze
7
+ @built_at = "2024-05-03".freeze
8
+ @git_commit_sha = "24cac00613".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
data/lib/bundler/cli.rb CHANGED
@@ -5,6 +5,7 @@ require_relative "vendored_thor"
5
5
  module Bundler
6
6
  class CLI < Thor
7
7
  require_relative "cli/common"
8
+ require_relative "cli/install"
8
9
 
9
10
  package_name "Bundler"
10
11
 
@@ -69,7 +70,7 @@ module Bundler
69
70
  Bundler.settings.set_command_option_if_given :retry, options[:retry]
70
71
 
71
72
  current_cmd = args.last[:current_command].name
72
- auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
73
+ Bundler.auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
73
74
  rescue UnknownArgumentError => e
74
75
  raise InvalidOption, e.message
75
76
  ensure
@@ -114,6 +115,8 @@ module Bundler
114
115
  class_option "verbose", type: :boolean, desc: "Enable verbose output mode", aliases: "-V"
115
116
 
116
117
  def help(cli = nil)
118
+ cli = self.class.all_aliases[cli] if self.class.all_aliases[cli]
119
+
117
120
  case cli
118
121
  when "gemfile" then command = "gemfile"
119
122
  when nil then command = "bundle"
@@ -347,6 +350,7 @@ module Bundler
347
350
  method_option "github", type: :string
348
351
  method_option "branch", type: :string
349
352
  method_option "ref", type: :string
353
+ method_option "glob", type: :string, banner: "The location of a dependency's .gemspec, expanded within Ruby (single quotes recommended)"
350
354
  method_option "skip-install", type: :boolean, banner: "Adds gem to the Gemfile but does not install it"
351
355
  method_option "optimistic", type: :boolean, banner: "Adds optimistic declaration of version to gem"
352
356
  method_option "strict", type: :boolean, banner: "Adds strict declaration of version to gem"
@@ -682,7 +686,6 @@ module Bundler
682
686
  exec_used = args.index {|a| exec_commands.include? a }
683
687
 
684
688
  command = args.find {|a| bundler_commands.include? a }
685
- command = all_aliases[command] if all_aliases[command]
686
689
 
687
690
  if exec_used && help_used
688
691
  if exec_used + help_used == 1
@@ -735,26 +738,6 @@ module Bundler
735
738
 
736
739
  private
737
740
 
738
- # Automatically invoke `bundle install` and resume if
739
- # Bundler.settings[:auto_install] exists. This is set through config cmd
740
- # `bundle config set --global auto_install 1`.
741
- #
742
- # Note that this method `nil`s out the global Definition object, so it
743
- # should be called first, before you instantiate anything like an
744
- # `Installer` that'll keep a reference to the old one instead.
745
- def auto_install
746
- return unless Bundler.settings[:auto_install]
747
-
748
- begin
749
- Bundler.definition.specs
750
- rescue GemNotFound, GitError
751
- Bundler.ui.info "Automatically installing missing gems."
752
- Bundler.reset!
753
- invoke :install, []
754
- Bundler.reset!
755
- end
756
- end
757
-
758
741
  def current_command
759
742
  _, _, config = @_initializer
760
743
  config[:current_command]
@@ -92,11 +92,12 @@ module Bundler
92
92
  @platforms = @locked_platforms.dup
93
93
  @locked_bundler_version = @locked_gems.bundler_version
94
94
  @locked_ruby_version = @locked_gems.ruby_version
95
+ @originally_locked_deps = @locked_gems.dependencies
95
96
  @originally_locked_specs = SpecSet.new(@locked_gems.specs)
96
97
  @locked_checksums = @locked_gems.checksums
97
98
 
98
99
  if unlock != true
99
- @locked_deps = @locked_gems.dependencies
100
+ @locked_deps = @originally_locked_deps
100
101
  @locked_specs = @originally_locked_specs
101
102
  @locked_sources = @locked_gems.sources
102
103
  else
@@ -111,6 +112,7 @@ module Bundler
111
112
  @locked_gems = nil
112
113
  @locked_deps = {}
113
114
  @locked_specs = SpecSet.new([])
115
+ @originally_locked_deps = {}
114
116
  @originally_locked_specs = @locked_specs
115
117
  @locked_sources = []
116
118
  @locked_platforms = []
@@ -130,7 +132,7 @@ module Bundler
130
132
  @sources.merged_gem_lockfile_sections!(locked_gem_sources.first)
131
133
  end
132
134
 
133
- @unlock[:sources] ||= []
135
+ @sources_to_unlock = @unlock.delete(:sources) || []
134
136
  @unlock[:ruby] ||= if @ruby_version && locked_ruby_version_object
135
137
  @ruby_version.diff(locked_ruby_version_object)
136
138
  end
@@ -142,11 +144,13 @@ module Bundler
142
144
  @path_changes = converge_paths
143
145
  @source_changes = converge_sources
144
146
 
147
+ @explicit_unlocks = @unlock.delete(:gems) || []
148
+
145
149
  if @unlock[:conservative]
146
- @unlock[:gems] ||= @dependencies.map(&:name)
150
+ @gems_to_unlock = @explicit_unlocks.any? ? @explicit_unlocks : @dependencies.map(&:name)
147
151
  else
148
- eager_unlock = (@unlock[:gems] || []).map {|name| Dependency.new(name, ">= 0") }
149
- @unlock[:gems] = @locked_specs.for(eager_unlock, false, platforms).map(&:name).uniq
152
+ eager_unlock = @explicit_unlocks.map {|name| Dependency.new(name, ">= 0") }
153
+ @gems_to_unlock = @locked_specs.for(eager_unlock, false, platforms).map(&:name).uniq
150
154
  end
151
155
 
152
156
  @dependency_changes = converge_dependencies
@@ -225,7 +229,6 @@ module Bundler
225
229
  @resolver = nil
226
230
  @resolution_packages = nil
227
231
  @specs = nil
228
- @gem_version_promoter = nil
229
232
 
230
233
  Bundler.ui.debug "The definition is missing dependencies, failed to resolve & materialize locally (#{e})"
231
234
  true
@@ -566,8 +569,10 @@ module Bundler
566
569
  @resolution_packages ||= begin
567
570
  last_resolve = converge_locked_specs
568
571
  remove_invalid_platforms!(current_dependencies)
569
- packages = Resolver::Base.new(source_requirements, expanded_dependencies, last_resolve, @platforms, locked_specs: @originally_locked_specs, unlock: @unlock[:gems], prerelease: gem_version_promoter.pre?)
570
- additional_base_requirements_for_resolve(packages, last_resolve)
572
+ packages = Resolver::Base.new(source_requirements, expanded_dependencies, last_resolve, @platforms, locked_specs: @originally_locked_specs, unlock: @gems_to_unlock, prerelease: gem_version_promoter.pre?)
573
+ packages = additional_base_requirements_to_prevent_downgrades(packages, last_resolve)
574
+ packages = additional_base_requirements_to_force_updates(packages)
575
+ packages
571
576
  end
572
577
  end
573
578
 
@@ -671,14 +676,18 @@ module Bundler
671
676
 
672
677
  def change_reason
673
678
  if unlocking?
674
- unlock_reason = @unlock.reject {|_k, v| Array(v).empty? }.map do |k, v|
675
- if v == true
676
- k.to_s
677
- else
678
- v = Array(v)
679
- "#{k}: (#{v.join(", ")})"
680
- end
681
- end.join(", ")
679
+ unlock_targets = if @gems_to_unlock.any?
680
+ ["gems", @gems_to_unlock]
681
+ elsif @sources_to_unlock.any?
682
+ ["sources", @sources_to_unlock]
683
+ end
684
+
685
+ unlock_reason = if unlock_targets
686
+ "#{unlock_targets.first}: (#{unlock_targets.last.join(", ")})"
687
+ else
688
+ @unlock[:ruby] ? "ruby" : ""
689
+ end
690
+
682
691
  return "bundler is unlocking #{unlock_reason}"
683
692
  end
684
693
  [
@@ -733,7 +742,7 @@ module Bundler
733
742
  spec = @dependencies.find {|s| s.name == k }
734
743
  source = spec&.source
735
744
  if source&.respond_to?(:local_override!)
736
- source.unlock! if @unlock[:gems].include?(spec.name)
745
+ source.unlock! if @gems_to_unlock.include?(spec.name)
737
746
  locals << [source, source.local_override!(v)]
738
747
  end
739
748
  end
@@ -741,7 +750,7 @@ module Bundler
741
750
  sources_with_changes = locals.select do |source, changed|
742
751
  changed || specs_changed?(source)
743
752
  end.map(&:first)
744
- !sources_with_changes.each {|source| @unlock[:sources] << source.name }.empty?
753
+ !sources_with_changes.each {|source| @sources_to_unlock << source.name }.empty?
745
754
  end
746
755
 
747
756
  def check_lockfile
@@ -818,7 +827,7 @@ module Bundler
818
827
  # gem), unlock it. For git sources, this means to unlock the revision, which
819
828
  # will cause the `ref` used to be the most recent for the branch (or master) if
820
829
  # an explicit `ref` is not used.
821
- if source.respond_to?(:unlock!) && @unlock[:sources].include?(source.name)
830
+ if source.respond_to?(:unlock!) && @sources_to_unlock.include?(source.name)
822
831
  source.unlock!
823
832
  changes = true
824
833
  end
@@ -835,9 +844,7 @@ module Bundler
835
844
  dep.source = sources.get(dep.source)
836
845
  end
837
846
 
838
- next if unlocking?
839
-
840
- unless locked_dep = @locked_deps[dep.name]
847
+ unless locked_dep = @originally_locked_deps[dep.name]
841
848
  changes = true
842
849
  next
843
850
  end
@@ -864,7 +871,7 @@ module Bundler
864
871
  def converge_locked_specs
865
872
  converged = converge_specs(@locked_specs)
866
873
 
867
- resolve = SpecSet.new(converged.reject {|s| @unlock[:gems].include?(s.name) })
874
+ resolve = SpecSet.new(converged.reject {|s| @gems_to_unlock.include?(s.name) })
868
875
 
869
876
  diff = nil
870
877
 
@@ -897,7 +904,7 @@ module Bundler
897
904
 
898
905
  @specs_that_changed_sources << s if gemfile_source != lockfile_source
899
906
  deps << dep if !dep.source || lockfile_source.include?(dep.source)
900
- @unlock[:gems] << name if lockfile_source.include?(dep.source) && lockfile_source != gemfile_source
907
+ @gems_to_unlock << name if lockfile_source.include?(dep.source) && lockfile_source != gemfile_source
901
908
 
902
909
  # Replace the locked dependency's source with the equivalent source from the Gemfile
903
910
  s.source = gemfile_source
@@ -906,7 +913,7 @@ module Bundler
906
913
  s.source = default_source unless sources.get(lockfile_source)
907
914
  end
908
915
 
909
- next if @unlock[:sources].include?(s.source.name)
916
+ next if @sources_to_unlock.include?(s.source.name)
910
917
 
911
918
  # Path sources have special logic
912
919
  if s.source.instance_of?(Source::Path) || s.source.instance_of?(Source::Gemspec)
@@ -928,12 +935,12 @@ module Bundler
928
935
  else
929
936
  # If the spec is no longer in the path source, unlock it. This
930
937
  # commonly happens if the version changed in the gemspec
931
- @unlock[:gems] << name
938
+ @gems_to_unlock << name
932
939
  end
933
940
  end
934
941
 
935
942
  if dep.nil? && requested_dependencies.find {|d| name == d.name }
936
- @unlock[:gems] << s.name
943
+ @gems_to_unlock << s.name
937
944
  else
938
945
  converged << s
939
946
  end
@@ -1010,7 +1017,7 @@ module Bundler
1010
1017
  current == proposed
1011
1018
  end
1012
1019
 
1013
- def additional_base_requirements_for_resolve(resolution_packages, last_resolve)
1020
+ def additional_base_requirements_to_prevent_downgrades(resolution_packages, last_resolve)
1014
1021
  return resolution_packages unless @locked_gems && !sources.expired_sources?(@locked_gems.sources)
1015
1022
  converge_specs(@originally_locked_specs - last_resolve).each do |locked_spec|
1016
1023
  next if locked_spec.source.is_a?(Source::Path)
@@ -1019,6 +1026,28 @@ module Bundler
1019
1026
  resolution_packages
1020
1027
  end
1021
1028
 
1029
+ def additional_base_requirements_to_force_updates(resolution_packages)
1030
+ return resolution_packages if @explicit_unlocks.empty?
1031
+ full_update = dup_for_full_unlock.resolve
1032
+ @explicit_unlocks.each do |name|
1033
+ version = full_update[name].first&.version
1034
+ resolution_packages.base_requirements[name] = Gem::Requirement.new("= #{version}") if version
1035
+ end
1036
+ resolution_packages
1037
+ end
1038
+
1039
+ def dup_for_full_unlock
1040
+ unlocked_definition = self.class.new(@lockfile, @dependencies, @sources, true, @ruby_version, @optional_groups, @gemfiles)
1041
+ unlocked_definition.resolution_mode = { "local" => !@remote }
1042
+ unlocked_definition.setup_sources_for_resolve
1043
+ unlocked_definition.gem_version_promoter.tap do |gvp|
1044
+ gvp.level = gem_version_promoter.level
1045
+ gvp.strict = gem_version_promoter.strict
1046
+ gvp.pre = gem_version_promoter.pre
1047
+ end
1048
+ unlocked_definition
1049
+ end
1050
+
1022
1051
  def remove_invalid_platforms!(dependencies)
1023
1052
  return if Bundler.frozen_bundle?
1024
1053
 
@@ -7,7 +7,7 @@ require_relative "rubygems_ext"
7
7
  module Bundler
8
8
  class Dependency < Gem::Dependency
9
9
  attr_reader :autorequire
10
- attr_reader :groups, :platforms, :gemfile, :path, :git, :github, :branch, :ref
10
+ attr_reader :groups, :platforms, :gemfile, :path, :git, :github, :branch, :ref, :glob
11
11
 
12
12
  ALL_RUBY_VERSIONS = (18..27).to_a.concat((30..34).to_a).freeze
13
13
  PLATFORM_MAP = {
@@ -39,6 +39,7 @@ module Bundler
39
39
  @github = options["github"]
40
40
  @branch = options["branch"]
41
41
  @ref = options["ref"]
42
+ @glob = options["glob"]
42
43
  @platforms = Array(options["platforms"])
43
44
  @env = options["env"]
44
45
  @should_include = options.fetch("should_include", true)
@@ -19,14 +19,7 @@ module Bundler
19
19
  BUNDLER_PREFIX = "BUNDLER_ORIG_"
20
20
 
21
21
  def self.from_env
22
- new(env_to_hash(ENV), BUNDLER_KEYS)
23
- end
24
-
25
- def self.env_to_hash(env)
26
- to_hash = env.to_hash
27
- return to_hash unless Gem.win_platform?
28
-
29
- to_hash.each_with_object({}) {|(k,v), a| a[k.upcase] = v }
22
+ new(ENV.to_hash, BUNDLER_KEYS)
30
23
  end
31
24
 
32
25
  # @param env [Hash]
@@ -39,18 +32,7 @@ module Bundler
39
32
 
40
33
  # Replaces `ENV` with the bundler environment variables backed up
41
34
  def replace_with_backup
42
- unless Gem.win_platform?
43
- ENV.replace(backup)
44
- return
45
- end
46
-
47
- # Fallback logic for Windows below to workaround
48
- # https://bugs.ruby-lang.org/issues/16798. Can be dropped once all
49
- # supported rubies include the fix for that.
50
-
51
- ENV.clear
52
-
53
- backup.each {|k, v| ENV[k] = v }
35
+ ENV.replace(backup)
54
36
  end
55
37
 
56
38
  # @return [Hash]
@@ -120,9 +120,10 @@ module Bundler
120
120
  github = ", :github => \"#{d.github}\"" unless d.github.nil?
121
121
  branch = ", :branch => \"#{d.branch}\"" unless d.branch.nil?
122
122
  ref = ", :ref => \"#{d.ref}\"" unless d.ref.nil?
123
+ glob = ", :glob => \"#{d.glob}\"" unless d.glob.nil?
123
124
  require_path = ", :require => #{convert_autorequire(d.autorequire)}" unless d.autorequire.nil?
124
125
 
125
- %(gem #{name}#{requirement}#{group}#{source}#{path}#{git}#{github}#{branch}#{ref}#{require_path})
126
+ %(gem #{name}#{requirement}#{group}#{source}#{path}#{git}#{github}#{branch}#{ref}#{glob}#{require_path})
126
127
  end.join("\n")
127
128
  end
128
129
 
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-ADD" "1" "March 2024" ""
3
+ .TH "BUNDLE\-ADD" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-BINSTUBS" "1" "March 2024" ""
3
+ .TH "BUNDLE\-BINSTUBS" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CACHE" "1" "March 2024" ""
3
+ .TH "BUNDLE\-CACHE" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CHECK" "1" "March 2024" ""
3
+ .TH "BUNDLE\-CHECK" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
6
6
  .SH "SYNOPSIS"
@@ -9,6 +9,8 @@
9
9
  \fBcheck\fR searches the local machine for each of the gems requested in the Gemfile\. If all gems are found, Bundler prints a success message and exits with a status of 0\.
10
10
  .P
11
11
  If not, the first missing gem is listed and Bundler exits status 1\.
12
+ .P
13
+ If the lockfile needs to be updated then it will be resolved using the gems installed on the local machine, if they satisfy the requirements\.
12
14
  .SH "OPTIONS"
13
15
  .TP
14
16
  \fB\-\-dry\-run\fR
@@ -15,6 +15,9 @@ a status of 0.
15
15
 
16
16
  If not, the first missing gem is listed and Bundler exits status 1.
17
17
 
18
+ If the lockfile needs to be updated then it will be resolved using the gems
19
+ installed on the local machine, if they satisfy the requirements.
20
+
18
21
  ## OPTIONS
19
22
 
20
23
  * `--dry-run`:
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CLEAN" "1" "March 2024" ""
3
+ .TH "BUNDLE\-CLEAN" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CONFIG" "1" "March 2024" ""
3
+ .TH "BUNDLE\-CONFIG" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-config\fR \- Set bundler configuration options
6
6
  .SH "SYNOPSIS"
@@ -95,8 +95,6 @@ Any periods in the configuration keys must be replaced with two underscores when
95
95
  .SH "LIST OF AVAILABLE KEYS"
96
96
  The following is a list of all configuration keys and their purpose\. You can learn more about their operation in bundle install(1) \fIbundle\-install\.1\.html\fR\.
97
97
  .IP "\(bu" 4
98
- \fBallow_deployment_source_credential_changes\fR (\fBBUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES\fR): When in deployment mode, allow changing the credentials to a gem's source\. Ex: \fBhttps://some\.host\.com/gems/path/\fR \-> \fBhttps://user_name:password@some\.host\.com/gems/path\fR
99
- .IP "\(bu" 4
100
98
  \fBallow_offline_install\fR (\fBBUNDLE_ALLOW_OFFLINE_INSTALL\fR): Allow Bundler to use cached data when installing without network access\.
101
99
  .IP "\(bu" 4
102
100
  \fBauto_clean_without_path\fR (\fBBUNDLE_AUTO_CLEAN_WITHOUT_PATH\fR): Automatically run \fBbundle clean\fR after installing when an explicit \fBpath\fR has not been set and Bundler is not installing into the system gems\.
@@ -137,9 +137,6 @@ the environment variable `BUNDLE_LOCAL__RACK`.
137
137
  The following is a list of all configuration keys and their purpose. You can
138
138
  learn more about their operation in [bundle install(1)](bundle-install.1.html).
139
139
 
140
- * `allow_deployment_source_credential_changes` (`BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES`):
141
- When in deployment mode, allow changing the credentials to a gem's source.
142
- Ex: `https://some.host.com/gems/path/` -> `https://user_name:password@some.host.com/gems/path`
143
140
  * `allow_offline_install` (`BUNDLE_ALLOW_OFFLINE_INSTALL`):
144
141
  Allow Bundler to use cached data when installing without network access.
145
142
  * `auto_clean_without_path` (`BUNDLE_AUTO_CLEAN_WITHOUT_PATH`):
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CONSOLE" "1" "March 2024" ""
3
+ .TH "BUNDLE\-CONSOLE" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-DOCTOR" "1" "March 2024" ""
3
+ .TH "BUNDLE\-DOCTOR" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-EXEC" "1" "March 2024" ""
3
+ .TH "BUNDLE\-EXEC" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-GEM" "1" "March 2024" ""
3
+ .TH "BUNDLE\-GEM" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-HELP" "1" "March 2024" ""
3
+ .TH "BUNDLE\-HELP" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-help\fR \- Displays detailed help for each subcommand
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INFO" "1" "March 2024" ""
3
+ .TH "BUNDLE\-INFO" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INIT" "1" "March 2024" ""
3
+ .TH "BUNDLE\-INIT" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INJECT" "1" "March 2024" ""
3
+ .TH "BUNDLE\-INJECT" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INSTALL" "1" "March 2024" ""
3
+ .TH "BUNDLE\-INSTALL" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-LIST" "1" "March 2024" ""
3
+ .TH "BUNDLE\-LIST" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-list\fR \- List all the gems in the bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-LOCK" "1" "March 2024" ""
3
+ .TH "BUNDLE\-LOCK" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-OPEN" "1" "March 2024" ""
3
+ .TH "BUNDLE\-OPEN" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-OUTDATED" "1" "March 2024" ""
3
+ .TH "BUNDLE\-OUTDATED" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-PLATFORM" "1" "March 2024" ""
3
+ .TH "BUNDLE\-PLATFORM" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-platform\fR \- Displays platform compatibility information
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-PLUGIN" "1" "March 2024" ""
3
+ .TH "BUNDLE\-PLUGIN" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-plugin\fR \- Manage Bundler plugins
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-PRISTINE" "1" "March 2024" ""
3
+ .TH "BUNDLE\-PRISTINE" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-REMOVE" "1" "March 2024" ""
3
+ .TH "BUNDLE\-REMOVE" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-SHOW" "1" "March 2024" ""
3
+ .TH "BUNDLE\-SHOW" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-UPDATE" "1" "March 2024" ""
3
+ .TH "BUNDLE\-UPDATE" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-update\fR \- Update your gems to the latest available versions
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-VERSION" "1" "March 2024" ""
3
+ .TH "BUNDLE\-VERSION" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-version\fR \- Prints Bundler version information
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-VIZ" "1" "March 2024" ""
3
+ .TH "BUNDLE\-VIZ" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE" "1" "March 2024" ""
3
+ .TH "BUNDLE" "1" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\fR \- Ruby Dependency Management
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "GEMFILE" "5" "March 2024" ""
3
+ .TH "GEMFILE" "5" "April 2024" ""
4
4
  .SH "NAME"
5
5
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
6
6
  .SH "SYNOPSIS"
@@ -146,6 +146,18 @@ module Gem
146
146
  end
147
147
  end
148
148
 
149
+ module BetterPermissionError
150
+ def data
151
+ Bundler::SharedHelpers.filesystem_access(loaded_from, :read) do
152
+ super
153
+ end
154
+ end
155
+ end
156
+
157
+ class StubSpecification
158
+ prepend BetterPermissionError
159
+ end
160
+
149
161
  class Dependency
150
162
  include ::Bundler::ForcePlatform
151
163
 
@@ -7,7 +7,6 @@ module Bundler
7
7
  autoload :Validator, File.expand_path("settings/validator", __dir__)
8
8
 
9
9
  BOOL_KEYS = %w[
10
- allow_deployment_source_credential_changes
11
10
  allow_offline_install
12
11
  auto_clean_without_path
13
12
  auto_install
data/lib/bundler/setup.rb CHANGED
@@ -5,6 +5,9 @@ require_relative "shared_helpers"
5
5
  if Bundler::SharedHelpers.in_bundle?
6
6
  require_relative "../bundler"
7
7
 
8
+ # try to auto_install first before we get to the `Bundler.ui.silence`, so user knows what is happening
9
+ Bundler.auto_install
10
+
8
11
  if STDOUT.tty? || ENV["BUNDLER_FORCE_TTY"]
9
12
  begin
10
13
  Bundler.ui.silence { Bundler.setup }
@@ -10,7 +10,7 @@ module Bundler
10
10
  # Ask for X gems per API request
11
11
  API_REQUEST_SIZE = 50
12
12
 
13
- attr_reader :remotes
13
+ attr_accessor :remotes
14
14
 
15
15
  def initialize(options = {})
16
16
  @options = options
@@ -96,7 +96,7 @@ module Bundler
96
96
  def to_lock
97
97
  out = String.new("GEM\n")
98
98
  remotes.reverse_each do |remote|
99
- out << " remote: #{suppress_configured_credentials remote}\n"
99
+ out << " remote: #{remove_auth remote}\n"
100
100
  end
101
101
  out << " specs:\n"
102
102
  end
@@ -312,11 +312,7 @@ module Bundler
312
312
  end
313
313
 
314
314
  def credless_remotes
315
- if Bundler.settings[:allow_deployment_source_credential_changes]
316
- remotes.map(&method(:remove_auth))
317
- else
318
- remotes.map(&method(:suppress_configured_credentials))
319
- end
315
+ remotes.map(&method(:remove_auth))
320
316
  end
321
317
 
322
318
  def remotes_for_spec(spec)
@@ -355,15 +351,6 @@ module Bundler
355
351
  uri
356
352
  end
357
353
 
358
- def suppress_configured_credentials(remote)
359
- remote_nouser = remove_auth(remote)
360
- if remote.userinfo && remote.userinfo == Bundler.settings[remote_nouser]
361
- remote_nouser
362
- else
363
- remote
364
- end
365
- end
366
-
367
354
  def remove_auth(remote)
368
355
  if remote.user || remote.password
369
356
  remote.dup.tap {|uri| uri.user = uri.password = nil }.to_s
@@ -157,7 +157,11 @@ module Bundler
157
157
  end
158
158
 
159
159
  def map_sources(replacement_sources)
160
- rubygems, git, plugin = [@rubygems_sources, @git_sources, @plugin_sources].map do |sources|
160
+ rubygems = @rubygems_sources.map do |source|
161
+ replace_rubygems_source(replacement_sources, source) || source
162
+ end
163
+
164
+ git, plugin = [@git_sources, @plugin_sources].map do |sources|
161
165
  sources.map do |source|
162
166
  replacement_sources.find {|s| s == source } || source
163
167
  end
@@ -171,13 +175,22 @@ module Bundler
171
175
  end
172
176
 
173
177
  def global_replacement_source(replacement_sources)
174
- replacement_source = replacement_sources.find {|s| s == global_rubygems_source }
178
+ replacement_source = replace_rubygems_source(replacement_sources, global_rubygems_source)
175
179
  return global_rubygems_source unless replacement_source
176
180
 
177
181
  replacement_source.cached!
178
182
  replacement_source
179
183
  end
180
184
 
185
+ def replace_rubygems_source(replacement_sources, gemfile_source)
186
+ replacement_source = replacement_sources.find {|s| s == gemfile_source }
187
+ return unless replacement_source
188
+
189
+ # locked sources never include credentials so always prefer remotes from the gemfile
190
+ replacement_source.remotes = gemfile_source.remotes
191
+ replacement_source
192
+ end
193
+
181
194
  def different_sources?(lock_sources, replacement_sources)
182
195
  !equivalent_sources?(lock_sources, replacement_sources)
183
196
  end
@@ -65,7 +65,7 @@ module Bundler
65
65
 
66
66
  platforms.concat(new_platforms)
67
67
 
68
- less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform }
68
+ less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform && platform === Bundler.local_platform }
69
69
  platforms.delete(Bundler.local_platform) if less_specific_platform
70
70
 
71
71
  platforms
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.5.9".freeze
4
+ VERSION = "2.5.10".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
data/lib/bundler.rb CHANGED
@@ -40,6 +40,7 @@ module Bundler
40
40
  SUDO_MUTEX = Thread::Mutex.new
41
41
 
42
42
  autoload :Checksum, File.expand_path("bundler/checksum", __dir__)
43
+ autoload :CLI, File.expand_path("bundler/cli", __dir__)
43
44
  autoload :CIDetector, File.expand_path("bundler/ci_detector", __dir__)
44
45
  autoload :Definition, File.expand_path("bundler/definition", __dir__)
45
46
  autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
@@ -165,6 +166,25 @@ module Bundler
165
166
  end
166
167
  end
167
168
 
169
+ # Automatically install dependencies if Bundler.settings[:auto_install] exists.
170
+ # This is set through config cmd `bundle config set --global auto_install 1`.
171
+ #
172
+ # Note that this method `nil`s out the global Definition object, so it
173
+ # should be called first, before you instantiate anything like an
174
+ # `Installer` that'll keep a reference to the old one instead.
175
+ def auto_install
176
+ return unless settings[:auto_install]
177
+
178
+ begin
179
+ definition.specs
180
+ rescue GemNotFound, GitError
181
+ ui.info "Automatically installing missing gems."
182
+ reset!
183
+ CLI::Install.new({}).run
184
+ reset!
185
+ end
186
+ end
187
+
168
188
  # Setups Bundler environment (see Bundler.setup) if it is not already set,
169
189
  # and loads all gems from groups specified. Unlike ::setup, can be called
170
190
  # multiple times with different groups (if they were allowed by setup).
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.5.9
4
+ version: 2.5.10
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: 2024-04-12 00:00:00.000000000 Z
25
+ date: 2024-05-03 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
@@ -399,7 +399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
399
399
  - !ruby/object:Gem::Version
400
400
  version: 3.2.3
401
401
  requirements: []
402
- rubygems_version: 3.5.9
402
+ rubygems_version: 3.5.10
403
403
  signing_key:
404
404
  specification_version: 4
405
405
  summary: The best way to manage your application's dependencies