rubygems-update 3.3.1 → 3.3.2

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: 2f3cab95c0495f8346fe4ddaa9d60f798d06132f484f36749d10035c29a9cab8
4
- data.tar.gz: fecd45d7fa7b3c41ae7af764b062b8355d6986aadab9b513759e2af75a9d8720
3
+ metadata.gz: 032d5c25431f07d56614be5feb4310775b0beca1cd1150d477655a46999c25e4
4
+ data.tar.gz: 1c45327dfd8164fbafc2407a6fe2ba21257a827d25a3040ccc803fd4d8ef2400
5
5
  SHA512:
6
- metadata.gz: b4b89fb3675c171488c620a0d88998e5f31de023160b77d804c0cab871b8b09446e32e018e2a8923451bf8b2ee33d20c66e6374db97468c1654d677fafb12d37
7
- data.tar.gz: 0e4ddbea298fca2bcbbdddf41bf90d9853d565e705ee5adb1035f6fd85d941ced05c4370511cc12102cc8804753d132a7ccc461316c90cd4644473995e3a0087
6
+ metadata.gz: 5edd1acdf9e66fe8e5e3b263da1921c30a687b2a83defac7c74a39530e7c63dc6b4eaea4dfec3c0c162123cacbc0d1e20a39e53030566efb7ba56b464ced97cf
7
+ data.tar.gz: 0f3c91e64ca5e5c28e8ccd3baf74b44785b8d1c129b2d155b58b5dcef0f68dbb0be67a4ff2b00d2dbfb8dd066827960afde2c11da6a25c2b474e3a086b30bb21
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 3.3.2 / 2021-12-23
2
+
3
+ ## Enhancements:
4
+
5
+ * Fix deprecations when activating DidYouMean for misspelled command
6
+ suggestions. Pull request #5211 by yuki24
7
+ * Installs bundler 2.3.2 as a default gem.
8
+
9
+ ## Bug fixes:
10
+
11
+ * Fix gemspec truncation. Pull request #5208 by deivid-rodriguez
12
+
1
13
  # 3.3.1 / 2021-12-22
2
14
 
3
15
  ## Enhancements:
data/Manifest.txt CHANGED
@@ -18,6 +18,7 @@ bundler/bundler.gemspec
18
18
  bundler/exe/bundle
19
19
  bundler/exe/bundler
20
20
  bundler/lib/bundler.rb
21
+ bundler/lib/bundler/.document
21
22
  bundler/lib/bundler/build_metadata.rb
22
23
  bundler/lib/bundler/capistrano.rb
23
24
  bundler/lib/bundler/cli.rb
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 2.3.2 (December 23, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Remove unnecessary lockfile upgrade warning [#5209](https://github.com/rubygems/rubygems/pull/5209)
6
+
1
7
  # 2.3.1 (December 22, 2021)
2
8
 
3
9
  ## Enhancements:
@@ -0,0 +1 @@
1
+ # not in RDoc
@@ -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 = "2021-12-22".freeze
8
- @git_commit_sha = "7b38ca2f84".freeze
7
+ @built_at = "2021-12-24".freeze
8
+ @git_commit_sha = "c3c71e7434".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -292,10 +292,7 @@ module Bundler
292
292
  locked_major = @locked_bundler_version.segments.first
293
293
  current_major = Gem::Version.create(Bundler::VERSION).segments.first
294
294
 
295
- if updating_major = locked_major < current_major
296
- Bundler.ui.warn "Warning: the lockfile is being updated to Bundler #{current_major}, " \
297
- "after which you will be unable to return to Bundler #{locked_major}."
298
- end
295
+ updating_major = locked_major < current_major
299
296
  end
300
297
 
301
298
  preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.3.1".freeze
4
+ VERSION = "2.3.2".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -24,10 +24,14 @@ class Gem::UnknownCommandError < Gem::Exception
24
24
  return if defined?(@attached)
25
25
 
26
26
  if defined?(DidYouMean::SPELL_CHECKERS) && defined?(DidYouMean::Correctable)
27
- DidYouMean::SPELL_CHECKERS['Gem::UnknownCommandError'] =
28
- Gem::UnknownCommandSpellChecker
27
+ if DidYouMean.respond_to?(:correct_error)
28
+ DidYouMean.correct_error(Gem::UnknownCommandError, Gem::UnknownCommandSpellChecker)
29
+ else
30
+ DidYouMean::SPELL_CHECKERS['Gem::UnknownCommandError'] =
31
+ Gem::UnknownCommandSpellChecker
29
32
 
30
- prepend DidYouMean::Correctable
33
+ prepend DidYouMean::Correctable
34
+ end
31
35
  end
32
36
 
33
37
  @attached = true
@@ -1116,7 +1116,7 @@ class Gem::Specification < Gem::BasicSpecification
1116
1116
  file = file.dup.tap(&Gem::UNTAINT)
1117
1117
  return unless File.file?(file)
1118
1118
 
1119
- code = File.read file, :mode => 'r:UTF-8:-'
1119
+ code = Gem.open_with_flock(file, 'r:UTF-8:-', &:read)
1120
1120
 
1121
1121
  code.tap(&Gem::UNTAINT)
1122
1122
 
@@ -110,7 +110,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
110
110
  begin
111
111
  saved_lineno = $.
112
112
 
113
- File.open loaded_from, OPEN_MODE do |file|
113
+ Gem.open_with_flock loaded_from, OPEN_MODE do |file|
114
114
  begin
115
115
  file.readline # discard encoding line
116
116
  stubline = file.readline.chomp
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = "3.3.1".freeze
11
+ VERSION = "3.3.2".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -163,16 +163,6 @@ module Gem
163
163
  specifications/default
164
164
  ].freeze
165
165
 
166
- ##
167
- # Exception classes used in a Gem.read_binary +rescue+ statement
168
-
169
- READ_BINARY_ERRORS = [Errno::EACCES, Errno::EROFS, Errno::ENOSYS, Errno::ENOTSUP].freeze
170
-
171
- ##
172
- # Exception classes used in Gem.write_binary +rescue+ statement
173
-
174
- WRITE_BINARY_ERRORS = [Errno::ENOSYS, Errno::ENOTSUP].freeze
175
-
176
166
  @@win_platform = nil
177
167
 
178
168
  @configuration = nil
@@ -776,40 +766,42 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
776
766
  # Safely read a file in binary mode on all platforms.
777
767
 
778
768
  def self.read_binary(path)
779
- File.open path, 'rb+' do |f|
780
- f.flock(File::LOCK_EX)
781
- f.read
782
- end
783
- rescue *READ_BINARY_ERRORS
784
- File.open path, 'rb' do |f|
785
- f.read
769
+ open_with_flock(path, 'rb+') do |io|
770
+ io.read
786
771
  end
787
- rescue Errno::ENOLCK # NFS
788
- if Thread.main != Thread.current
789
- raise
790
- else
791
- File.open path, 'rb' do |f|
792
- f.read
793
- end
772
+ rescue Errno::EACCES, Errno::EROFS
773
+ open_with_flock(path, 'rb') do |io|
774
+ io.read
794
775
  end
795
776
  end
796
777
 
797
778
  ##
798
779
  # Safely write a file in binary mode on all platforms.
799
780
  def self.write_binary(path, data)
800
- File.open(path, File::RDWR | File::CREAT | File::LOCK_EX, binmode: true) do |io|
781
+ open_with_flock(path, 'wb') do |io|
801
782
  io.write data
802
783
  end
803
- rescue *WRITE_BINARY_ERRORS
804
- File.open(path, 'wb') do |io|
805
- io.write data
784
+ end
785
+
786
+ ##
787
+ # Open a file with given flags, and protect access with flock
788
+
789
+ def self.open_with_flock(path, flags, &block)
790
+ File.open(path, flags) do |io|
791
+ unless java_platform?
792
+ begin
793
+ io.flock(File::LOCK_EX)
794
+ rescue Errno::ENOSYS, Errno::ENOTSUP
795
+ end
796
+ end
797
+ yield io
806
798
  end
807
799
  rescue Errno::ENOLCK # NFS
808
800
  if Thread.main != Thread.current
809
801
  raise
810
802
  else
811
- File.open(path, 'wb') do |io|
812
- io.write data
803
+ File.open(path, flags) do |io|
804
+ yield io
813
805
  end
814
806
  end
815
807
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.3.1"
5
+ s.version = "3.3.2"
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
 
@@ -782,6 +782,39 @@ ERROR: Possible alternatives: non_existent_with_hint
782
782
  assert_match "1 gem installed", @ui.output
783
783
  end
784
784
 
785
+ def test_execute_remote_truncates_existing_gemspecs
786
+ spec_fetcher do |fetcher|
787
+ fetcher.gem 'a', 1
788
+ end
789
+
790
+ @cmd.options[:domain] = :remote
791
+
792
+ @cmd.options[:args] = %w[a]
793
+
794
+ use_ui @ui do
795
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
796
+ @cmd.execute
797
+ end
798
+ end
799
+
800
+ assert_equal %w[a-1], @cmd.installed_specs.map {|spec| spec.full_name }
801
+ assert_match "1 gem installed", @ui.output
802
+
803
+ a1_gemspec = File.join(@gemhome, 'specifications', "a-1.gemspec")
804
+
805
+ initial_a1_gemspec_content = File.read(a1_gemspec)
806
+ modified_a1_gemspec_content = initial_a1_gemspec_content + "\n # AAAAAAA\n"
807
+ File.write(a1_gemspec, modified_a1_gemspec_content)
808
+
809
+ use_ui @ui do
810
+ assert_raise Gem::MockGemUi::SystemExitException, @ui.error do
811
+ @cmd.execute
812
+ end
813
+ end
814
+
815
+ assert_equal initial_a1_gemspec_content, File.read(a1_gemspec)
816
+ end
817
+
785
818
  def test_execute_remote_ignores_files
786
819
  specs = spec_fetcher do |fetcher|
787
820
  fetcher.gem 'a', 1
@@ -288,33 +288,6 @@ gem 'other', version
288
288
  "(SyntaxError)", e.message
289
289
  end
290
290
 
291
- def test_ensure_no_race_conditions_between_installing_and_loading_gemspecs
292
- a, a_gem = util_gem 'a', 2
293
-
294
- Gem::Installer.at(a_gem).install
295
-
296
- t1 = Thread.new do
297
- 5.times do
298
- Gem::Installer.at(a_gem).install
299
- sleep 0.1
300
- end
301
- end
302
-
303
- t2 = Thread.new do
304
- _, err = capture_output do
305
- 20.times do
306
- Gem::Specification.load(a.spec_file)
307
- Gem::Specification.send(:clear_load_cache)
308
- end
309
- end
310
-
311
- assert_empty err
312
- end
313
-
314
- t1.join
315
- t2.join
316
- end
317
-
318
291
  def test_ensure_loadable_spec_security_policy
319
292
  pend 'openssl is missing' unless Gem::HAVE_OPENSSL
320
293
 
@@ -5,7 +5,7 @@ require 'timeout'
5
5
 
6
6
  class TestGemStreamUI < Gem::TestCase
7
7
  # increase timeout with MJIT for --jit-wait testing
8
- mjit_enabled = defined?(RubyVM::JIT) ? RubyVM::JIT.enabled? : defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
8
+ mjit_enabled = defined?(RubyVM::MJIT) ? RubyVM::MJIT.enabled? : defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
9
9
  SHORT_TIMEOUT = (RUBY_ENGINE == "ruby" && !mjit_enabled) ? 0.1 : 1.0
10
10
 
11
11
  module IsTty
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.3.1
4
+ version: 3.3.2
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: 2021-12-22 00:00:00.000000000 Z
19
+ date: 2021-12-24 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
@@ -74,6 +74,7 @@ files:
74
74
  - bundler/exe/bundle
75
75
  - bundler/exe/bundler
76
76
  - bundler/lib/bundler.rb
77
+ - bundler/lib/bundler/.document
77
78
  - bundler/lib/bundler/build_metadata.rb
78
79
  - bundler/lib/bundler/capistrano.rb
79
80
  - bundler/lib/bundler/cli.rb
@@ -803,7 +804,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
803
804
  - !ruby/object:Gem::Version
804
805
  version: '0'
805
806
  requirements: []
806
- rubygems_version: 3.3.1
807
+ rubygems_version: 3.3.2
807
808
  signing_key:
808
809
  specification_version: 4
809
810
  summary: RubyGems is a package management framework for Ruby.