rubygems-update 3.6.8 → 3.7.0

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 (151) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +874 -787
  3. data/CONTRIBUTING.md +9 -0
  4. data/Manifest.txt +6 -22
  5. data/README.md +1 -1
  6. data/SECURITY.md +7 -0
  7. data/bundler/CHANGELOG.md +1103 -1030
  8. data/bundler/README.md +7 -7
  9. data/bundler/bundler.gemspec +2 -2
  10. data/bundler/lib/bundler/build_metadata.rb +10 -11
  11. data/bundler/lib/bundler/cli/common.rb +1 -1
  12. data/bundler/lib/bundler/cli/config.rb +2 -2
  13. data/bundler/lib/bundler/cli/doctor/diagnose.rb +167 -0
  14. data/bundler/lib/bundler/cli/doctor/ssl.rb +249 -0
  15. data/bundler/lib/bundler/cli/doctor.rb +27 -155
  16. data/bundler/lib/bundler/cli/gem.rb +62 -30
  17. data/bundler/lib/bundler/cli/install.rb +4 -4
  18. data/bundler/lib/bundler/cli/issue.rb +2 -2
  19. data/bundler/lib/bundler/cli/outdated.rb +1 -1
  20. data/bundler/lib/bundler/cli/update.rb +2 -2
  21. data/bundler/lib/bundler/cli.rb +12 -25
  22. data/bundler/lib/bundler/compact_index_client.rb +1 -5
  23. data/bundler/lib/bundler/current_ruby.rb +27 -3
  24. data/bundler/lib/bundler/definition.rb +55 -58
  25. data/bundler/lib/bundler/dependency.rb +1 -1
  26. data/bundler/lib/bundler/dsl.rb +33 -23
  27. data/bundler/lib/bundler/feature_flag.rb +15 -12
  28. data/bundler/lib/bundler/fetcher/dependency.rb +2 -1
  29. data/bundler/lib/bundler/fetcher/downloader.rb +33 -7
  30. data/bundler/lib/bundler/fetcher.rb +49 -19
  31. data/bundler/lib/bundler/friendly_errors.rb +2 -1
  32. data/bundler/lib/bundler/index.rb +7 -2
  33. data/bundler/lib/bundler/installer.rb +5 -4
  34. data/bundler/lib/bundler/lazy_specification.rb +29 -18
  35. data/bundler/lib/bundler/lockfile_parser.rb +21 -5
  36. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-config.1 +172 -126
  42. data/bundler/lib/bundler/man/bundle-config.1.ronn +91 -91
  43. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-doctor.1 +43 -4
  45. data/bundler/lib/bundler/man/bundle-doctor.1.ronn +48 -4
  46. data/bundler/lib/bundler/man/bundle-env.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle-fund.1 +1 -1
  49. data/bundler/lib/bundler/man/bundle-gem.1 +67 -44
  50. data/bundler/lib/bundler/man/bundle-gem.1.ronn +8 -4
  51. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  54. data/bundler/lib/bundler/man/bundle-inject.1 +2 -2
  55. data/bundler/lib/bundler/man/bundle-inject.1.ronn +1 -1
  56. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  57. data/bundler/lib/bundler/man/bundle-issue.1 +1 -1
  58. data/bundler/lib/bundler/man/bundle-licenses.1 +1 -1
  59. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  60. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  61. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  62. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  63. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  64. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  65. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  66. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  67. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  68. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  69. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  70. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  71. data/bundler/lib/bundler/man/bundle.1 +1 -1
  72. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  73. data/bundler/lib/bundler/match_platform.rb +31 -12
  74. data/bundler/lib/bundler/materialization.rb +2 -2
  75. data/bundler/lib/bundler/resolver/package.rb +1 -1
  76. data/bundler/lib/bundler/resolver.rb +11 -9
  77. data/bundler/lib/bundler/rubygems_ext.rb +116 -120
  78. data/bundler/lib/bundler/rubygems_integration.rb +11 -6
  79. data/bundler/lib/bundler/runtime.rb +1 -1
  80. data/bundler/lib/bundler/self_manager.rb +32 -42
  81. data/bundler/lib/bundler/settings/validator.rb +0 -23
  82. data/bundler/lib/bundler/settings.rb +4 -6
  83. data/bundler/lib/bundler/shared_helpers.rb +6 -4
  84. data/bundler/lib/bundler/source/git/git_proxy.rb +3 -3
  85. data/bundler/lib/bundler/source/path.rb +7 -0
  86. data/bundler/lib/bundler/source_list.rb +1 -5
  87. data/bundler/lib/bundler/source_map.rb +1 -1
  88. data/bundler/lib/bundler/spec_set.rb +28 -6
  89. data/bundler/lib/bundler/templates/Executable +0 -11
  90. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -0
  91. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -5
  92. data/bundler/lib/bundler/ui/shell.rb +2 -2
  93. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  94. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
  95. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +81 -42
  96. data/bundler/lib/bundler/version.rb +10 -2
  97. data/bundler/lib/bundler/worker.rb +1 -1
  98. data/bundler/lib/bundler.rb +14 -12
  99. data/doc/bundler/UPGRADING.md +137 -127
  100. data/doc/rubygems/CONTRIBUTING.md +1 -1
  101. data/lib/rubygems/basic_specification.rb +7 -0
  102. data/lib/rubygems/commands/pristine_command.rb +9 -12
  103. data/lib/rubygems/commands/push_command.rb +2 -1
  104. data/lib/rubygems/commands/setup_command.rb +2 -2
  105. data/lib/rubygems/core_ext/kernel_require.rb +5 -2
  106. data/lib/rubygems/ext/builder.rb +15 -4
  107. data/lib/rubygems/ext/cargo_builder.rb +7 -5
  108. data/lib/rubygems/ext/rake_builder.rb +1 -3
  109. data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +10 -3
  110. data/lib/rubygems/gemcutter_utilities.rb +5 -2
  111. data/lib/rubygems/installer.rb +45 -50
  112. data/lib/rubygems/package/tar_writer.rb +5 -4
  113. data/lib/rubygems/platform.rb +142 -39
  114. data/lib/rubygems/remote_fetcher.rb +3 -3
  115. data/lib/rubygems/request_set.rb +3 -6
  116. data/lib/rubygems/resolver/best_set.rb +1 -1
  117. data/lib/rubygems/resolver/source_set.rb +1 -1
  118. data/lib/rubygems/resolver.rb +1 -1
  119. data/lib/rubygems/s3_uri_signer.rb +5 -3
  120. data/lib/rubygems/source.rb +28 -22
  121. data/lib/rubygems/specification.rb +2 -2
  122. data/lib/rubygems/uri_formatter.rb +2 -1
  123. data/lib/rubygems/util/licenses.rb +21 -0
  124. data/lib/rubygems/vendor/net-http/lib/net/http.rb +14 -19
  125. data/lib/rubygems/vendor/resolv/lib/resolv.rb +50 -22
  126. data/lib/rubygems.rb +65 -7
  127. data/rubygems-update.gemspec +2 -2
  128. data/setup.rb +1 -1
  129. metadata +9 -25
  130. data/bundler/lib/bundler/gem_helpers.rb +0 -144
  131. data/bundler/lib/bundler/templates/Executable.bundler +0 -109
  132. data/bundler/lib/bundler/vendor/fileutils/.document +0 -1
  133. data/bundler/lib/bundler/vendor/net-http-persistent/.document +0 -1
  134. data/bundler/lib/bundler/vendor/pub_grub/.document +0 -1
  135. data/bundler/lib/bundler/vendor/securerandom/.document +0 -1
  136. data/bundler/lib/bundler/vendor/thor/.document +0 -1
  137. data/bundler/lib/bundler/vendor/tsort/.document +0 -1
  138. data/bundler/lib/bundler/vendor/uri/.document +0 -1
  139. data/lib/rubygems/shellwords.rb +0 -3
  140. data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +0 -21
  141. data/lib/rubygems/vendor/molinillo/.document +0 -1
  142. data/lib/rubygems/vendor/net-http/.document +0 -1
  143. data/lib/rubygems/vendor/net-protocol/.document +0 -1
  144. data/lib/rubygems/vendor/optparse/.document +0 -1
  145. data/lib/rubygems/vendor/resolv/.document +0 -1
  146. data/lib/rubygems/vendor/securerandom/.document +0 -1
  147. data/lib/rubygems/vendor/timeout/.document +0 -1
  148. data/lib/rubygems/vendor/tsort/.document +0 -1
  149. data/lib/rubygems/vendor/uri/.document +0 -1
  150. /data/lib/rubygems/ssl_certs/rubygems.org/{GlobalSignRootCA_R3.pem → GlobalSign.pem} +0 -0
  151. /data/{bundler/lib/bundler/vendor/connection_pool → lib/rubygems/vendor}/.document +0 -0
@@ -214,16 +214,11 @@ module Bundler
214
214
  e.requirement = dep.requirement
215
215
  raise e
216
216
  end
217
-
218
- # backwards compatibility shim, see https://github.com/rubygems/bundler/issues/5102
219
- kernel_class.send(:public, :gem) if Bundler.feature_flag.setup_makes_kernel_gem_public?
220
217
  end
221
218
  end
222
219
 
223
220
  # Used to give better error messages when activating specs outside of the current bundle
224
221
  def replace_bin_path(specs_by_name)
225
- gem_class = (class << Gem; self; end)
226
-
227
222
  redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args|
228
223
  exec_name = args.first
229
224
  raise ArgumentError, "you must supply exec_name" unless exec_name
@@ -345,9 +340,13 @@ module Bundler
345
340
  Gem::Specification.all = specs
346
341
  end
347
342
 
348
- redefine_method((class << Gem; self; end), :finish_resolve) do |*|
343
+ redefine_method(gem_class, :finish_resolve) do |*|
349
344
  []
350
345
  end
346
+
347
+ redefine_method(gem_class, :load_plugins) do |*|
348
+ load_plugin_files specs.flat_map(&:plugins)
349
+ end
351
350
  end
352
351
 
353
352
  def plain_specs
@@ -447,6 +446,12 @@ module Bundler
447
446
  def default_stubs
448
447
  Gem::Specification.default_stubs("*.gemspec")
449
448
  end
449
+
450
+ private
451
+
452
+ def gem_class
453
+ class << Gem; self; end
454
+ end
450
455
  end
451
456
 
452
457
  def self.rubygems
@@ -71,7 +71,7 @@ module Bundler
71
71
  raise Bundler::GemRequireError.new e,
72
72
  "There was an error while trying to load the gem '#{file}'."
73
73
  end
74
- rescue RuntimeError => e
74
+ rescue StandardError => e
75
75
  raise Bundler::GemRequireError.new e,
76
76
  "There was an error while trying to load the gem '#{file}'."
77
77
  end
@@ -7,13 +7,15 @@ module Bundler
7
7
  #
8
8
  class SelfManager
9
9
  def restart_with_locked_bundler_if_needed
10
- return unless needs_switching? && installed?
10
+ restart_version = find_restart_version
11
+ return unless restart_version && installed?(restart_version)
11
12
 
12
13
  restart_with(restart_version)
13
14
  end
14
15
 
15
16
  def install_locked_bundler_and_restart_with_it_if_needed
16
- return unless needs_switching?
17
+ restart_version = find_restart_version
18
+ return unless restart_version
17
19
 
18
20
  if restart_version == lockfile_version
19
21
  Bundler.ui.info \
@@ -29,8 +31,6 @@ module Bundler
29
31
  end
30
32
 
31
33
  def update_bundler_and_restart_with_it_if_needed(target)
32
- return unless autoswitching_applies?
33
-
34
34
  spec = resolve_update_version_from(target)
35
35
  return unless spec
36
36
 
@@ -38,7 +38,7 @@ module Bundler
38
38
 
39
39
  Bundler.ui.info "Updating bundler to #{version}."
40
40
 
41
- install(spec)
41
+ install(spec) unless installed?(version)
42
42
 
43
43
  restart_with(version)
44
44
  end
@@ -68,47 +68,37 @@ module Bundler
68
68
 
69
69
  def restart_with(version)
70
70
  configured_gem_home = ENV["GEM_HOME"]
71
+ configured_orig_gem_home = ENV["BUNDLER_ORIG_GEM_HOME"]
71
72
  configured_gem_path = ENV["GEM_PATH"]
73
+ configured_orig_gem_path = ENV["BUNDLER_ORIG_GEM_PATH"]
72
74
 
73
- # Bundler specs need some stuff to be required before Bundler starts
74
- # running, for example, for faking the compact index API. However, these
75
- # flags are lost when we reexec to a different version of Bundler. In the
76
- # future, we may be able to properly reconstruct the original Ruby
77
- # invocation (see https://bugs.ruby-lang.org/issues/6648), but for now
78
- # there's no way to do it, so we need to be explicit about how to re-exec.
79
- # This may be a feature end users request at some point, but maybe by that
80
- # time, we have builtin tools to do. So for now, we use an undocumented
81
- # ENV variable only for our specs.
82
- bundler_spec_original_cmd = ENV["BUNDLER_SPEC_ORIGINAL_CMD"]
83
- if bundler_spec_original_cmd
84
- require "shellwords"
85
- cmd = [*Shellwords.shellsplit(bundler_spec_original_cmd), *ARGV]
86
- else
87
- argv0 = File.exist?($PROGRAM_NAME) ? $PROGRAM_NAME : Process.argv0
88
- cmd = [argv0, *ARGV]
89
- cmd.unshift(Gem.ruby) unless File.executable?(argv0)
90
- end
75
+ argv0 = File.exist?($PROGRAM_NAME) ? $PROGRAM_NAME : Process.argv0
76
+ cmd = [argv0, *ARGV]
77
+ cmd.unshift(Gem.ruby) unless File.executable?(argv0)
91
78
 
92
79
  Bundler.with_original_env do
93
80
  Kernel.exec(
94
- { "GEM_HOME" => configured_gem_home, "GEM_PATH" => configured_gem_path, "BUNDLER_VERSION" => version.to_s },
81
+ {
82
+ "GEM_HOME" => configured_gem_home,
83
+ "BUNDLER_ORIG_GEM_HOME" => configured_orig_gem_home,
84
+ "GEM_PATH" => configured_gem_path,
85
+ "BUNDLER_ORIG_GEM_PATH" => configured_orig_gem_path,
86
+ "BUNDLER_VERSION" => version.to_s,
87
+ },
95
88
  *cmd
96
89
  )
97
90
  end
98
91
  end
99
92
 
100
- def needs_switching?
93
+ def needs_switching?(restart_version)
101
94
  autoswitching_applies? &&
102
- Bundler.settings[:version] != "system" &&
103
95
  released?(restart_version) &&
104
- !running?(restart_version) &&
105
- !updating?
96
+ !running?(restart_version)
106
97
  end
107
98
 
108
99
  def autoswitching_applies?
109
100
  ENV["BUNDLER_VERSION"].nil? &&
110
101
  ruby_can_restart_with_same_arguments? &&
111
- SharedHelpers.in_bundle? &&
112
102
  lockfile_version
113
103
  end
114
104
 
@@ -142,6 +132,7 @@ module Bundler
142
132
  end
143
133
 
144
134
  def find_latest_matching_spec(requirement)
135
+ Bundler.configure
145
136
  local_result = find_latest_matching_spec_from_collection(local_specs, requirement)
146
137
  return local_result if local_result && requirement.specific?
147
138
 
@@ -171,18 +162,14 @@ module Bundler
171
162
  $PROGRAM_NAME != "-e"
172
163
  end
173
164
 
174
- def updating?
175
- "update".start_with?(ARGV.first || " ") && ARGV[1..-1].any? {|a| a.start_with?("--bundler") }
176
- end
177
-
178
- def installed?
165
+ def installed?(restart_version)
179
166
  Bundler.configure
180
167
 
181
168
  Bundler.rubygems.find_bundler(restart_version.to_s)
182
169
  end
183
170
 
184
171
  def current_version
185
- @current_version ||= Gem::Version.new(Bundler::VERSION)
172
+ @current_version ||= Bundler.gem_version
186
173
  end
187
174
 
188
175
  def lockfile_version
@@ -194,13 +181,16 @@ module Bundler
194
181
  @lockfile_version = nil
195
182
  end
196
183
 
197
- def restart_version
198
- return @restart_version if defined?(@restart_version)
199
- # BUNDLE_VERSION=x.y.z
200
- @restart_version = Gem::Version.new(Bundler.settings[:version])
201
- rescue ArgumentError
202
- # BUNDLE_VERSION=lockfile
203
- @restart_version = lockfile_version
184
+ def find_restart_version
185
+ return unless SharedHelpers.in_bundle?
186
+
187
+ configured_version = Bundler.settings[:version]
188
+ return if configured_version == "system"
189
+
190
+ restart_version = configured_version == "lockfile" ? lockfile_version : Gem::Version.new(configured_version)
191
+ return unless needs_switching?(restart_version)
192
+
193
+ restart_version
204
194
  end
205
195
  end
206
196
  end
@@ -74,29 +74,6 @@ module Bundler
74
74
  fail!(key, value, "`#{other_key}` is current set to #{other_setting.inspect}", "the `#{conflicting.join("`, `")}` groups conflict")
75
75
  end
76
76
  end
77
-
78
- rule %w[path], "relative paths are expanded relative to the current working directory" do |key, value, settings|
79
- next if value.nil?
80
-
81
- path = Pathname.new(value)
82
- next if !path.relative? || !Bundler.feature_flag.path_relative_to_cwd?
83
-
84
- path = path.expand_path
85
-
86
- root = begin
87
- Bundler.root
88
- rescue GemfileNotFound
89
- Pathname.pwd.expand_path
90
- end
91
-
92
- path = begin
93
- path.relative_path_from(root)
94
- rescue ArgumentError
95
- path
96
- end
97
-
98
- set(settings, key, path.to_s)
99
- end
100
77
  end
101
78
  end
102
79
  end
@@ -8,12 +8,10 @@ module Bundler
8
8
 
9
9
  BOOL_KEYS = %w[
10
10
  allow_offline_install
11
- auto_clean_without_path
12
11
  auto_install
13
12
  cache_all
14
13
  cache_all_platforms
15
14
  clean
16
- default_install_uses_path
17
15
  deployment
18
16
  disable_checksum_validation
19
17
  disable_exec_load
@@ -27,6 +25,7 @@ module Bundler
27
25
  gem.changelog
28
26
  gem.coc
29
27
  gem.mit
28
+ gem.bundle
30
29
  git.allow_insecure
31
30
  global_gem_cache
32
31
  ignore_messages
@@ -35,15 +34,13 @@ module Bundler
35
34
  lockfile_checksums
36
35
  no_install
37
36
  no_prune
38
- path_relative_to_cwd
39
37
  path.system
40
38
  plugins
41
39
  prefer_patch
42
- print_only_version_number
43
- setup_makes_kernel_gem_public
44
40
  silence_deprecations
45
41
  silence_root_warning
46
42
  update_requires_all_flag
43
+ verbose
47
44
  ].freeze
48
45
 
49
46
  REMEMBERED_KEYS = %w[
@@ -86,6 +83,7 @@ module Bundler
86
83
  gemfile
87
84
  path
88
85
  shebang
86
+ simulate_version
89
87
  system_bindir
90
88
  trust-policy
91
89
  version
@@ -274,7 +272,7 @@ module Bundler
274
272
  def use_system_gems?
275
273
  return true if system_path
276
274
  return false if explicit_path
277
- !Bundler.feature_flag.default_install_uses_path?
275
+ !Bundler.feature_flag.bundler_4_mode?
278
276
  end
279
277
 
280
278
  def base_path
@@ -133,13 +133,16 @@ module Bundler
133
133
  removed_message += suffix if removed_message
134
134
  end
135
135
 
136
- bundler_major_version = Bundler.bundler_major_version
137
- if bundler_major_version > major_version
136
+ require_relative "../bundler"
137
+
138
+ feature_flag = Bundler.feature_flag
139
+
140
+ if feature_flag.removed_major?(major_version)
138
141
  require_relative "errors"
139
142
  raise DeprecatedError, "[REMOVED] #{removed_message || message}"
140
143
  end
141
144
 
142
- return unless bundler_major_version >= major_version && prints_major_deprecations?
145
+ return unless feature_flag.deprecated_major?(major_version) && prints_major_deprecations?
143
146
  Bundler.ui.warn("[DEPRECATED] #{message}")
144
147
  end
145
148
 
@@ -386,7 +389,6 @@ module Bundler
386
389
  end
387
390
 
388
391
  def prints_major_deprecations?
389
- require_relative "../bundler"
390
392
  return false if Bundler.settings[:silence_deprecations]
391
393
  require_relative "deprecate"
392
394
  return false if Bundler::Deprecate.skip
@@ -305,8 +305,8 @@ module Bundler
305
305
  end
306
306
 
307
307
  def has_revision_cached?
308
- return unless @revision && path.exist?
309
- git("cat-file", "-e", @revision, dir: path)
308
+ return unless commit && path.exist?
309
+ git("cat-file", "-e", commit, dir: path)
310
310
  true
311
311
  rescue GitError
312
312
  false
@@ -408,7 +408,7 @@ module Bundler
408
408
  def capture3_args_for(cmd, dir)
409
409
  return ["git", *cmd] unless dir
410
410
 
411
- if Bundler.feature_flag.bundler_3_mode? || supports_minus_c?
411
+ if Bundler.feature_flag.bundler_4_mode? || supports_minus_c?
412
412
  ["git", "-C", dir.to_s, *cmd]
413
413
  else
414
414
  ["git", *cmd, { chdir: dir.to_s }]
@@ -167,6 +167,13 @@ module Bundler
167
167
  next unless spec = load_gemspec(file)
168
168
  spec.source = self
169
169
 
170
+ # The ignore attribute is for ignoring installed gems that don't
171
+ # have extensions correctly compiled for activation. In the case of
172
+ # path sources, there's a single version of each gem in the path
173
+ # source available to Bundler, so we always certainly want to
174
+ # consider that for activation and never makes sense to ignore it.
175
+ spec.ignored = false
176
+
170
177
  # Validation causes extension_dir to be calculated, which depends
171
178
  # on #source, so we validate here instead of load_gemspec
172
179
  validate_spec(spec)
@@ -103,7 +103,7 @@ module Bundler
103
103
  end
104
104
 
105
105
  def get(source)
106
- source_list_for(source).find {|s| equivalent_source?(source, s) }
106
+ source_list_for(source).find {|s| s.include?(source) }
107
107
  end
108
108
 
109
109
  def lock_sources
@@ -265,9 +265,5 @@ module Bundler
265
265
  def equivalent_sources?(lock_sources, replacement_sources)
266
266
  lock_sources.sort_by(&:identifier) == replacement_sources.sort_by(&:identifier)
267
267
  end
268
-
269
- def equivalent_source?(source, other_source)
270
- source == other_source
271
- end
272
268
  end
273
269
  end
@@ -23,7 +23,7 @@ module Bundler
23
23
  if previous_source.nil?
24
24
  requirements[indirect_dependency_name] = source
25
25
  else
26
- no_ambiguous_sources = Bundler.feature_flag.bundler_3_mode?
26
+ no_ambiguous_sources = Bundler.feature_flag.bundler_4_mode?
27
27
 
28
28
  msg = ["The gem '#{indirect_dependency_name}' was found in multiple relevant sources."]
29
29
  msg.concat [previous_source, source].map {|s| " * #{s}" }.sort
@@ -29,6 +29,7 @@ module Bundler
29
29
  end
30
30
 
31
31
  def normalize_platforms!(deps, platforms)
32
+ remove_invalid_platforms!(deps, platforms)
32
33
  add_extra_platforms!(platforms)
33
34
 
34
35
  platforms.map! do |platform|
@@ -53,6 +54,20 @@ module Bundler
53
54
  end
54
55
  end
55
56
 
57
+ def remove_invalid_platforms!(deps, platforms, skips: [])
58
+ invalid_platforms = []
59
+
60
+ platforms.reject! do |platform|
61
+ next false if skips.include?(platform)
62
+
63
+ invalid = incomplete_for_platform?(deps, platform)
64
+ invalid_platforms << platform if invalid
65
+ invalid
66
+ end
67
+
68
+ invalid_platforms
69
+ end
70
+
56
71
  def add_extra_platforms!(platforms)
57
72
  if @specs.empty?
58
73
  platforms.concat([Gem::Platform::RUBY]).uniq
@@ -61,7 +76,7 @@ module Bundler
61
76
 
62
77
  new_platforms = all_platforms.select do |platform|
63
78
  next if platforms.include?(platform)
64
- next unless GemHelpers.generic(platform) == Gem::Platform::RUBY
79
+ next unless Gem::Platform.generic(platform) == Gem::Platform::RUBY
65
80
 
66
81
  complete_platform(platform)
67
82
  end
@@ -130,12 +145,15 @@ module Bundler
130
145
  end
131
146
 
132
147
  def incomplete_for_platform?(deps, platform)
133
- return false if @specs.empty?
148
+ incomplete_specs_for_platform(deps, platform).any?
149
+ end
150
+
151
+ def incomplete_specs_for_platform(deps, platform)
152
+ return [] if @specs.empty?
134
153
 
135
154
  validation_set = self.class.new(@specs)
136
155
  validation_set.for(deps, [platform])
137
-
138
- validation_set.incomplete_specs.any?
156
+ validation_set.incomplete_specs
139
157
  end
140
158
 
141
159
  def missing_specs_for(deps)
@@ -161,11 +179,13 @@ module Bundler
161
179
  end
162
180
 
163
181
  def -(other)
182
+ SharedHelpers.major_deprecation 2, "SpecSet#- has been removed with no replacement"
183
+
164
184
  SpecSet.new(to_a - other.to_a)
165
185
  end
166
186
 
167
187
  def find_by_name_and_platform(name, platform)
168
- @specs.detect {|spec| spec.name == name && spec.match_platform(platform) }
188
+ @specs.detect {|spec| spec.name == name && spec.installable_on_platform?(platform) }
169
189
  end
170
190
 
171
191
  def specs_with_additional_variants_from(other)
@@ -192,6 +212,8 @@ module Bundler
192
212
  end
193
213
 
194
214
  def <<(spec)
215
+ SharedHelpers.major_deprecation 2, "SpecSet#<< has been removed with no replacement"
216
+
195
217
  @specs << spec
196
218
  end
197
219
 
@@ -262,7 +284,7 @@ module Bundler
262
284
  valid_platform = lookup.all? do |_, specs|
263
285
  spec = specs.first
264
286
  matching_specs = spec.source.specs.search([spec.name, spec.version])
265
- platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find do |s|
287
+ platform_spec = MatchPlatform.select_best_platform_match(matching_specs, platform).find do |s|
266
288
  valid?(s)
267
289
  end
268
290
 
@@ -10,17 +10,6 @@
10
10
 
11
11
  ENV["BUNDLE_GEMFILE"] ||= File.expand_path("<%= relative_gemfile_path %>", __dir__)
12
12
 
13
- bundle_binstub = File.expand_path("bundle", __dir__)
14
-
15
- if File.file?(bundle_binstub)
16
- if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17
- load(bundle_binstub)
18
- else
19
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
- end
22
- end
23
-
24
13
  require "rubygems"
25
14
  require "bundler/setup"
26
15
 
@@ -18,6 +18,8 @@ jobs:
18
18
 
19
19
  steps:
20
20
  - uses: actions/checkout@v4
21
+ with:
22
+ persist-credentials: false
21
23
  <%- if config[:ext] == 'rust' -%>
22
24
  - name: Set up Ruby & Rust
23
25
  uses: oxidize-rb/actions/setup-ruby-and-rust@v1
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = "TODO: Write a short summary, because RubyGems requires one."
12
12
  spec.description = "TODO: Write a longer description or delete this line."
13
- spec.homepage = "TODO: Put your gem's website or public repo URL here."
13
+ spec.homepage = "<%= config[:homepage_uri] %>"
14
14
  <%- if config[:mit] -%>
15
15
  spec.license = "MIT"
16
16
  <%- end -%>
@@ -20,10 +20,11 @@ Gem::Specification.new do |spec|
20
20
  <%- end -%>
21
21
 
22
22
  spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
23
-
24
23
  spec.metadata["homepage_uri"] = spec.homepage
25
- spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
26
- spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
24
+ spec.metadata["source_code_uri"] = "<%= config[:source_code_uri] %>"
25
+ <%- if config[:changelog] -%>
26
+ spec.metadata["changelog_uri"] = "<%= config[:changelog_uri] %>"
27
+ <%- end -%>
27
28
 
28
29
  # Specify which files should be added to the gem when it is released.
29
30
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -31,7 +32,7 @@ Gem::Specification.new do |spec|
31
32
  spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
32
33
  ls.readlines("\x0", chomp: true).reject do |f|
33
34
  (f == gemspec) ||
34
- f.start_with?(*%w[bin/ test/ spec/ features/ .git <%= config[:ci_config_path] %>appveyor Gemfile])
35
+ f.start_with?(*%w[<%= config[:ignore_paths].join(" ") %>])
35
36
  end
36
37
  end
37
38
  spec.bindir = "exe"
@@ -80,11 +80,11 @@ module Bundler
80
80
  end
81
81
 
82
82
  def ask(msg)
83
- @shell.ask(msg)
83
+ @shell.ask(msg, :green)
84
84
  end
85
85
 
86
86
  def yes?(msg)
87
- @shell.yes?(msg)
87
+ @shell.yes?(msg, :green)
88
88
  end
89
89
 
90
90
  def no?(msg)
@@ -1,7 +1,7 @@
1
1
  = net-http-persistent
2
2
 
3
3
  home :: https://github.com/drbrain/net-http-persistent
4
- rdoc :: https://rdoc.info/gems/net-http-persistent
4
+ rdoc :: https://rubydoc.info/gems/net-http-persistent
5
5
 
6
6
  == DESCRIPTION:
7
7
 
@@ -63,7 +63,8 @@ class Gem::Net::HTTP::Persistent::TimedStackMulti < Bundler::ConnectionPool::Tim
63
63
  if @created >= @max && @enqueued >= 1
64
64
  oldest, = @lru.first
65
65
  @lru.delete oldest
66
- @ques[oldest].pop
66
+ connection = @ques[oldest].pop
67
+ connection.close if connection.respond_to?(:close)
67
68
 
68
69
  @created -= 1
69
70
  end