rubygems-update 3.4.14 → 3.4.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d8a97e5b6198a831e3a4f9394870dbf6a2d53b720cfd769bf11876061199bb1
4
- data.tar.gz: 0623b2dbd7c85370eabf89e2f908d4fbeb59ffcd725eac2bf883e0b760a9402d
3
+ metadata.gz: 79b6b95727a03e85042c318c19b9161d61f0f70813bd839229aafe15dd171044
4
+ data.tar.gz: 31630ced1a24e78dc72f9838f6869e4242418f63af238e4cbc15d697384f64ac
5
5
  SHA512:
6
- metadata.gz: 8a95e7a9fd03a2552b5d1c3be6529ddf8c13b352f1ba7b9079a914dd060275386a6f2fa1a47b0b68b9a2ee68b67d37a1bdf31a90d0716bd9b805d73421d579d0
7
- data.tar.gz: 172343a13367b7973cc14f9c721b92a876cc518e00ab257d6af34424b25011053e3bfed66f16dd005f59ca5da32d5c825f6d36845d99ed14f74caf44710a2e8f
6
+ metadata.gz: 1d6488ea569f1b00fa710c3cf5aedff8f5f06ce2f019d6b8aa172aba4878457a877a4418301c98ed74b7f62ef97b64cca5929586eb60b7e33366f42511bc995d
7
+ data.tar.gz: 813e2629c91f36981977bd077e89deadee4eca9d503a2c5f72796665b7e771ae5f66b6a7f364a73bca39a170bc3d281fff042f990e04b82b360d81d1e66905a1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # 3.4.15 / 2023-06-29
2
+
3
+ ## Enhancements:
4
+
5
+ * Installs bundler 2.4.15 as a default gem.
6
+
7
+ ## Bug fixes:
8
+
9
+ * Autoload shellwords when it's needed. Pull request
10
+ [#6734](https://github.com/rubygems/rubygems/pull/6734) by ioquatix
11
+
12
+ ## Documentation:
13
+
14
+ * Update command to test local gem command changes. Pull request
15
+ [#6761](https://github.com/rubygems/rubygems/pull/6761) by jenshenny
16
+
1
17
  # 3.4.14 / 2023-06-12
2
18
 
3
19
  ## Enhancements:
@@ -700,7 +716,7 @@
700
716
 
701
717
  ## Enhancements:
702
718
 
703
- * Redact credentails when printing URI. Pull request [#4868](https://github.com/rubygems/rubygems/pull/4868) by intuxicated
719
+ * Redact credentials when printing URI. Pull request [#4868](https://github.com/rubygems/rubygems/pull/4868) by intuxicated
704
720
  * Prefer `require_relative` to `require` for internal requires. Pull
705
721
  request [#4858](https://github.com/rubygems/rubygems/pull/4858) by deivid-rodriguez
706
722
  * Prioritise gems with higher version for fetching metadata, and stop
data/CONTRIBUTING.md CHANGED
@@ -48,7 +48,7 @@ here: https://guides.rubygems.org/contributing/
48
48
 
49
49
  To run commands like `gem install` from the repo:
50
50
 
51
- ruby -Ilib bin/gem install
51
+ ruby -Ilib exe/gem install
52
52
 
53
53
  To run commands like `bundle install` from the repo:
54
54
 
data/Manifest.txt CHANGED
@@ -509,6 +509,7 @@ lib/rubygems/security/policy.rb
509
509
  lib/rubygems/security/signer.rb
510
510
  lib/rubygems/security/trust_dir.rb
511
511
  lib/rubygems/security_option.rb
512
+ lib/rubygems/shellwords.rb
512
513
  lib/rubygems/source.rb
513
514
  lib/rubygems/source/git.rb
514
515
  lib/rubygems/source/installed.rb
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 2.4.15 (June 29, 2023)
2
+
3
+ ## Enhancements:
4
+
5
+ - Improve edge case error message [#6733](https://github.com/rubygems/rubygems/pull/6733)
6
+
7
+ ## Bug fixes:
8
+
9
+ - Fix `bundle lock --update --bundler` [#6213](https://github.com/rubygems/rubygems/pull/6213)
10
+
1
11
  # 2.4.14 (June 12, 2023)
2
12
 
3
13
  ## 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-06-29".freeze
8
+ @git_commit_sha = "702f922bf2".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?
@@ -403,11 +400,20 @@ module Bundler
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?
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
@@ -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)
@@ -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
 
@@ -381,7 +381,6 @@ module Bundler
381
381
  idx = @allow_local ? installed_specs.dup : Index.new
382
382
 
383
383
  Dir["#{cache_path}/*.gem"].each do |gemfile|
384
- next if /^bundler\-[\d\.]+?\.gem/.match?(gemfile)
385
384
  s ||= Bundler.rubygems.spec_from_gem(gemfile)
386
385
  s.source = self
387
386
  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.15".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -6,6 +6,7 @@
6
6
  #++
7
7
 
8
8
  require_relative "../user_interaction"
9
+ require_relative "../shellwords"
9
10
 
10
11
  class Gem::Ext::Builder
11
12
  include Gem::UserInteraction
@@ -56,9 +57,8 @@ class Gem::Ext::Builder
56
57
  end
57
58
 
58
59
  def self.ruby
59
- require "shellwords"
60
60
  # Gem.ruby is quoted if it contains whitespace
61
- cmd = Gem.ruby.shellsplit
61
+ cmd = Shellwords.split(Gem.ruby)
62
62
 
63
63
  # This load_path is only needed when running rubygems test without a proper installation.
64
64
  # Prepending it in a normal installation will cause problem with order of $LOAD_PATH.
@@ -82,8 +82,7 @@ class Gem::Ext::Builder
82
82
  p(command)
83
83
  end
84
84
  results << "current directory: #{dir}"
85
- require "shellwords"
86
- results << command.shelljoin
85
+ results << Shellwords.join(command)
87
86
 
88
87
  require "open3"
89
88
  # Set $SOURCE_DATE_EPOCH for the subprocess.
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "../shellwords"
4
+
3
5
  # This class is used by rubygems to build Rust extensions. It is a thin-wrapper
4
6
  # over the `cargo rustc` command which takes care of building Rust code in a way
5
7
  # that Ruby can use.
@@ -73,8 +75,6 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
73
75
  end
74
76
 
75
77
  def cargo_command(cargo_toml, dest_path, args = [], crate_name = nil)
76
- require "shellwords"
77
-
78
78
  cmd = []
79
79
  cmd += [cargo, "rustc"]
80
80
  cmd += ["--crate-type", "cdylib"]
@@ -1,4 +1,7 @@
1
1
  # frozen_string_literal: true
2
+
3
+ require_relative "../shellwords"
4
+
2
5
  #--
3
6
  # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
4
7
  # All rights reserved.
@@ -14,8 +17,7 @@ class Gem::Ext::RakeBuilder < Gem::Ext::Builder
14
17
  rake = ENV["rake"]
15
18
 
16
19
  if rake
17
- require "shellwords"
18
- rake = rake.shellsplit
20
+ rake = Shellwords.split(rake)
19
21
  else
20
22
  begin
21
23
  rake = ruby << "-rrubygems" << Gem.bin_path("rake", "rake")
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ autoload :Shellwords, "shellwords"
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require "rbconfig"
9
9
 
10
10
  module Gem
11
- VERSION = "3.4.14"
11
+ VERSION = "3.4.15"
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.4.14"
5
+ s.version = "3.4.15"
6
6
  s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
7
7
  s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
8
8
 
@@ -213,8 +213,9 @@ class Gem::MockBrowser
213
213
  end
214
214
  end
215
215
 
216
- def self.post(uri)
217
- post = Net::HTTP::Post.new(uri)
216
+ def self.post(uri, content_type: "application/x-www-form-urlencoded")
217
+ headers = { "content-type" => content_type } if content_type
218
+ post = Net::HTTP::Post.new(uri, headers)
218
219
  Net::HTTP.start(uri.hostname, uri.port) do |http|
219
220
  http.request(post)
220
221
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.14
4
+ version: 3.4.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2023-06-12 00:00:00.000000000 Z
19
+ date: 2023-06-29 00:00:00.000000000 Z
20
20
  dependencies: []
21
21
  description: |-
22
22
  A package (also known as a library) contains a set of functionality
@@ -565,6 +565,7 @@ files:
565
565
  - lib/rubygems/security/signer.rb
566
566
  - lib/rubygems/security/trust_dir.rb
567
567
  - lib/rubygems/security_option.rb
568
+ - lib/rubygems/shellwords.rb
568
569
  - lib/rubygems/source.rb
569
570
  - lib/rubygems/source/git.rb
570
571
  - lib/rubygems/source/installed.rb
@@ -842,7 +843,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
842
843
  - !ruby/object:Gem::Version
843
844
  version: '0'
844
845
  requirements: []
845
- rubygems_version: 3.4.14
846
+ rubygems_version: 3.4.15
846
847
  signing_key:
847
848
  specification_version: 4
848
849
  summary: RubyGems is a package management framework for Ruby. This gem is downloaded