rubygems-update 3.5.1 → 3.5.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68772f80d218184806318e802c6a5e88ed914fe53f3d695330f50f88569745f6
4
- data.tar.gz: fb2147d62688fb56bdc5f315dc22160effe6a1789dd04bd8bce271b5588d4c89
3
+ metadata.gz: 9a96e34ca4dd3b27ea38ac7b9eda98c12cc74082774fc03a4747b2746f215993
4
+ data.tar.gz: 92f04742ef9d579ab430f766ca24fc89233a8463b57acdf07609fda64724c7e9
5
5
  SHA512:
6
- metadata.gz: 0ae310762d14c86b78f6471d75bfb1d444f64aab624679327b0cd34077100a633e5a0c716111eabcac5614fcaa9e8b93d4e4b3f672d2b5c5009d1276ff535061
7
- data.tar.gz: 8a7e01d1ccd2ab36449fdf135a71496d0efde044174e2c8ab823b3910824c0b9ab28550df5c33392f326703d634277b4b0d647bb1963d1f4e5b29569eeaa22c4
6
+ metadata.gz: d5bdc95e65579bf90563c99afd7c4f71573d12e3b564423ca90d277a672fadc712c576867b771287c042f8c141050c615f213c24a7f36c1800a75ffbf5d33ca0
7
+ data.tar.gz: 47dbd452c5a1e069c19c43d6f3c818768579aa6d792fd9cf9e774b6d310772587da33c9dfc9742cbb431daafa6a73ba890b5c1331903ae41a7152db9c3c366c3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ # 3.5.3 / 2023-12-22
2
+
3
+ ## Enhancements:
4
+
5
+ * Installs bundler 2.5.3 as a default gem.
6
+
7
+ # 3.5.2 / 2023-12-21
8
+
9
+ ## Enhancements:
10
+
11
+ * Support dynamic library loading with extension .so or .o. Pull request
12
+ [#7241](https://github.com/rubygems/rubygems/pull/7241) by hogelog
13
+ * Installs bundler 2.5.2 as a default gem.
14
+
15
+ ## Performance:
16
+
17
+ * Replace `object_id` comparison with identity Hash. Pull request
18
+ [#7303](https://github.com/rubygems/rubygems/pull/7303) by amomchilov
19
+ * Use IO.copy_stream when reading, writing. Pull request
20
+ [#6958](https://github.com/rubygems/rubygems/pull/6958) by martinemde
21
+
1
22
  # 3.5.1 / 2023-12-15
2
23
 
3
24
  ## Enhancements:
data/Manifest.txt CHANGED
@@ -313,7 +313,6 @@ bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb
313
313
  bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb
314
314
  bundler/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb
315
315
  bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb
316
- bundler/lib/bundler/vendor/thor/lib/thor/shell/lcs_diff.rb
317
316
  bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb
318
317
  bundler/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb
319
318
  bundler/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # 2.5.3 (December 22, 2023)
2
+
3
+ ## Bug fixes:
4
+
5
+ - Fix incorrect error when Gemfile overrides a gemspec development dependency [#7319](https://github.com/rubygems/rubygems/pull/7319)
6
+
7
+ # 2.5.2 (December 21, 2023)
8
+
9
+ ## Enhancements:
10
+
11
+ - Avoid vendored thor gem polluting the global namespace [#7305](https://github.com/rubygems/rubygems/pull/7305)
12
+
13
+ ## Bug fixes:
14
+
15
+ - Fix `bundle update --bundler` when latest version does not support current ruby [#7310](https://github.com/rubygems/rubygems/pull/7310)
16
+ - Fix incorrect lockfiles being generated in some situations [#7307](https://github.com/rubygems/rubygems/pull/7307)
17
+ - Fix incorrect re-resolve messages [#7306](https://github.com/rubygems/rubygems/pull/7306)
18
+
1
19
  # 2.5.1 (December 15, 2023)
2
20
 
3
21
  ## 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 = "2023-12-15".freeze
8
- @git_commit_sha = "c944d05909".freeze
7
+ @built_at = "2023-12-22".freeze
8
+ @git_commit_sha = "a04f70b115".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -496,7 +496,15 @@ module Bundler
496
496
  private :sources
497
497
 
498
498
  def nothing_changed?
499
- !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@missing_lockfile_dep && !@unlocking_bundler && !@invalid_lockfile_dep
499
+ !@source_changes &&
500
+ !@dependency_changes &&
501
+ !@new_platform &&
502
+ !@path_changes &&
503
+ !@local_changes &&
504
+ !@missing_lockfile_dep &&
505
+ !@unlocking_bundler &&
506
+ !@locked_spec_with_missing_deps &&
507
+ !@locked_spec_with_invalid_deps
500
508
  end
501
509
 
502
510
  def no_resolve_needed?
@@ -653,7 +661,8 @@ module Bundler
653
661
  [@local_changes, "the gemspecs for git local gems changed"],
654
662
  [@missing_lockfile_dep, "your lock file is missing \"#{@missing_lockfile_dep}\""],
655
663
  [@unlocking_bundler, "an update to the version of Bundler itself was requested"],
656
- [@invalid_lockfile_dep, "your lock file has an invalid dependency \"#{@invalid_lockfile_dep}\""],
664
+ [@locked_spec_with_missing_deps, "your lock file includes \"#{@locked_spec_with_missing_deps}\" but not some of its dependencies"],
665
+ [@locked_spec_with_invalid_deps, "your lockfile does not satisfy dependencies of \"#{@locked_spec_with_invalid_deps}\""],
657
666
  ].select(&:first).map(&:last).join(", ")
658
667
  end
659
668
 
@@ -708,26 +717,25 @@ module Bundler
708
717
  end
709
718
 
710
719
  def check_lockfile
711
- @invalid_lockfile_dep = nil
712
720
  @missing_lockfile_dep = nil
713
721
 
714
- locked_names = @locked_specs.map(&:name)
722
+ @locked_spec_with_invalid_deps = nil
723
+ @locked_spec_with_missing_deps = nil
724
+
715
725
  missing = []
716
726
  invalid = []
717
727
 
718
728
  @locked_specs.each do |s|
719
- s.dependencies.each do |dep|
720
- next if dep.name == "bundler"
729
+ validation = @locked_specs.validate_deps(s)
721
730
 
722
- missing << s unless locked_names.include?(dep.name)
723
- invalid << s if @locked_specs.none? {|spec| dep.matches_spec?(spec) }
724
- end
731
+ missing << s if validation == :missing
732
+ invalid << s if validation == :invalid
725
733
  end
726
734
 
727
735
  if missing.any?
728
736
  @locked_specs.delete(missing)
729
737
 
730
- @missing_lockfile_dep = missing.first.name
738
+ @locked_spec_with_missing_deps = missing.first.name
731
739
  elsif !@dependency_changes
732
740
  @missing_lockfile_dep = current_dependencies.find do |d|
733
741
  @locked_specs[d.name].empty? && d.name != "bundler"
@@ -737,7 +745,7 @@ module Bundler
737
745
  if invalid.any?
738
746
  @locked_specs.delete(invalid)
739
747
 
740
- @invalid_lockfile_dep = invalid.first.name
748
+ @locked_spec_with_invalid_deps = invalid.first.name
741
749
  end
742
750
  end
743
751
 
@@ -68,6 +68,10 @@ module Bundler
68
68
  @should_include && current_env? && current_platform?
69
69
  end
70
70
 
71
+ def gemspec_dev_dep?
72
+ type == :development
73
+ end
74
+
71
75
  def current_env?
72
76
  return true unless @env
73
77
  if @env.is_a?(Hash)
@@ -103,16 +103,21 @@ module Bundler
103
103
  # if there's already a dependency with this name we try to prefer one
104
104
  if current = @dependencies.find {|d| d.name == dep.name }
105
105
  # Always prefer the dependency from the Gemfile
106
- deleted_dep = @dependencies.delete(current) if current.type == :development
106
+ @dependencies.delete(current) if current.gemspec_dev_dep?
107
107
 
108
108
  if current.requirement != dep.requirement
109
109
  current_requirement_open = current.requirements_list.include?(">= 0")
110
110
 
111
- if current.type == :development
112
- unless current_requirement_open || dep.type == :development
113
- Bundler.ui.warn "A gemspec development dependency (#{dep.name}, #{current.requirement}) is being overridden by a Gemfile dependency (#{dep.name}, #{dep.requirement}).\n" \
114
- "This behaviour may change in the future. Please remove either of them, or make sure they both have the same requirement\n" \
111
+ gemspec_dep = [dep, current].find(&:gemspec_dev_dep?)
112
+ if gemspec_dep
113
+ gemfile_dep = [dep, current].find(&:runtime?)
114
+
115
+ unless current_requirement_open
116
+ Bundler.ui.warn "A gemspec development dependency (#{gemspec_dep.name}, #{gemspec_dep.requirement}) is being overridden by a Gemfile dependency (#{gemfile_dep.name}, #{gemfile_dep.requirement}).\n" \
117
+ "This behaviour may change in the future. Please remove either of them, or make sure they both have the same requirement\n"
115
118
  end
119
+
120
+ return if dep.gemspec_dev_dep?
116
121
  else
117
122
  update_prompt = ""
118
123
 
@@ -130,8 +135,8 @@ module Bundler
130
135
  "You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
131
136
  "#{update_prompt}"
132
137
  end
133
- elsif current.type == :development || dep.type == :development
134
- return if deleted_dep.nil?
138
+ elsif current.gemspec_dev_dep? || dep.gemspec_dev_dep?
139
+ return if dep.gemspec_dev_dep?
135
140
  elsif current.source != dep.source
136
141
  raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
137
142
  "You specified that #{dep.name} (#{dep.requirement}) should come from " \
@@ -10,6 +10,8 @@ module Bundler
10
10
  attr_reader :name, :version, :platform
11
11
  attr_accessor :source, :remote, :force_ruby_platform, :dependencies, :required_ruby_version, :required_rubygems_version
12
12
 
13
+ alias_method :runtime_dependencies, :dependencies
14
+
13
15
  def self.from_spec(s)
14
16
  lazy_spec = new(s.name, s.version, s.platform, s.source)
15
17
  lazy_spec.dependencies = s.dependencies
@@ -88,6 +88,10 @@ module Bundler
88
88
  end
89
89
  end
90
90
 
91
+ def runtime_dependencies
92
+ dependencies.select(&:runtime?)
93
+ end
94
+
91
95
  def git_version
92
96
  return unless loaded_from && source.is_a?(Bundler::Source::Git)
93
97
  " #{source.revision[0..6]}"
@@ -121,7 +121,7 @@ module Bundler
121
121
  source = Bundler::Source::Rubygems.new("remotes" => "https://rubygems.org")
122
122
  source.remote!
123
123
  source.add_dependency_names("bundler")
124
- source.specs
124
+ source.specs.select(&:matches_current_metadata?)
125
125
  end
126
126
  end
127
127
 
@@ -37,7 +37,7 @@ module Bundler
37
37
 
38
38
  specs_for_dep.first.dependencies.each do |d|
39
39
  next if d.type == :development
40
- incomplete = true if d.name != "bundler" && lookup[d.name].empty?
40
+ incomplete = true if d.name != "bundler" && lookup[d.name].nil?
41
41
  deps << [d, dep[1]]
42
42
  end
43
43
  else
@@ -45,7 +45,7 @@ module Bundler
45
45
  end
46
46
 
47
47
  if incomplete && check
48
- @incomplete_specs += lookup[name].any? ? lookup[name] : [LazySpecification.new(name, nil, nil)]
48
+ @incomplete_specs += lookup[name] || [LazySpecification.new(name, nil, nil)]
49
49
  end
50
50
  end
51
51
 
@@ -64,7 +64,9 @@ module Bundler
64
64
  valid_platform = lookup.all? do |_, specs|
65
65
  spec = specs.first
66
66
  matching_specs = spec.source.specs.search([spec.name, spec.version])
67
- platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find(&:matches_current_metadata?)
67
+ platform_spec = GemHelpers.select_best_platform_match(matching_specs, platform).find do |s|
68
+ s.matches_current_metadata? && valid_dependencies?(s)
69
+ end
68
70
 
69
71
  if platform_spec
70
72
  new_specs << LazySpecification.from_spec(platform_spec)
@@ -90,9 +92,20 @@ module Bundler
90
92
  platforms
91
93
  end
92
94
 
95
+ def validate_deps(s)
96
+ s.runtime_dependencies.each do |dep|
97
+ next if dep.name == "bundler"
98
+
99
+ return :missing unless names.include?(dep.name)
100
+ return :invalid if none? {|spec| dep.matches_spec?(spec) }
101
+ end
102
+
103
+ :valid
104
+ end
105
+
93
106
  def [](key)
94
107
  key = key.name if key.respond_to?(:name)
95
- lookup[key].reverse
108
+ lookup[key]&.reverse || []
96
109
  end
97
110
 
98
111
  def []=(key, value)
@@ -167,7 +180,7 @@ module Bundler
167
180
  end
168
181
 
169
182
  def what_required(spec)
170
- unless req = find {|s| s.dependencies.any? {|d| d.type == :runtime && d.name == spec.name } }
183
+ unless req = find {|s| s.runtime_dependencies.any? {|d| d.name == spec.name } }
171
184
  return [spec]
172
185
  end
173
186
  what_required(req) << spec
@@ -193,8 +206,16 @@ module Bundler
193
206
  sorted.each(&b)
194
207
  end
195
208
 
209
+ def names
210
+ lookup.keys
211
+ end
212
+
196
213
  private
197
214
 
215
+ def valid_dependencies?(s)
216
+ validate_deps(s) == :valid
217
+ end
218
+
198
219
  def sorted
199
220
  rake = @specs.find {|s| s.name == "rake" }
200
221
  begin
@@ -213,8 +234,9 @@ module Bundler
213
234
 
214
235
  def lookup
215
236
  @lookup ||= begin
216
- lookup = Hash.new {|h, k| h[k] = [] }
237
+ lookup = {}
217
238
  @specs.each do |s|
239
+ lookup[s.name] ||= []
218
240
  lookup[s.name] << s
219
241
  end
220
242
  lookup
@@ -228,6 +250,8 @@ module Bundler
228
250
 
229
251
  def specs_for_dependency(dep, platform)
230
252
  specs_for_name = lookup[dep.name]
253
+ return [] unless specs_for_name
254
+
231
255
  matching_specs = if dep.force_ruby_platform
232
256
  GemHelpers.force_ruby_platform(specs_for_name)
233
257
  else
@@ -240,7 +264,11 @@ module Bundler
240
264
  def tsort_each_child(s)
241
265
  s.dependencies.sort_by(&:name).each do |d|
242
266
  next if d.type == :development
243
- lookup[d.name].each {|s2| yield s2 }
267
+
268
+ specs_for_name = lookup[d.name]
269
+ next unless specs_for_name
270
+
271
+ specs_for_name.each {|s2| yield s2 }
244
272
  end
245
273
  end
246
274
  end
@@ -1,5 +1,4 @@
1
1
  require_relative "basic"
2
- require_relative "lcs_diff"
3
2
 
4
3
  class Bundler::Thor
5
4
  module Shell
@@ -7,8 +6,6 @@ class Bundler::Thor
7
6
  # Bundler::Thor::Shell::Basic to see all available methods.
8
7
  #
9
8
  class Color < Basic
10
- include LCSDiff
11
-
12
9
  # Embed in a String to clear all previous ANSI sequences.
13
10
  CLEAR = "\e[0m"
14
11
  # The start of an ANSI bold sequence.
@@ -1,5 +1,4 @@
1
1
  require_relative "basic"
2
- require_relative "lcs_diff"
3
2
 
4
3
  class Bundler::Thor
5
4
  module Shell
@@ -7,8 +6,6 @@ class Bundler::Thor
7
6
  # Bundler::Thor::Shell::Basic to see all available methods.
8
7
  #
9
8
  class HTML < Basic
10
- include LCSDiff
11
-
12
9
  # The start of an HTML bold sequence.
13
10
  BOLD = "font-weight: bold"
14
11
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.5.1".freeze
4
+ VERSION = "2.5.3".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -84,7 +84,13 @@ class Gem::BasicSpecification
84
84
  return false
85
85
  end
86
86
 
87
- have_file? file, Gem.suffixes
87
+ is_soext = file.end_with?(".so", ".o")
88
+
89
+ if is_soext
90
+ have_file? file.delete_suffix(File.extname(file)), Gem.dynamic_library_suffixes
91
+ else
92
+ have_file? file, Gem.suffixes
93
+ end
88
94
  end
89
95
 
90
96
  def default_gem?
@@ -268,7 +268,7 @@ class Gem::Package
268
268
 
269
269
  tar.add_file_simple file, stat.mode, stat.size do |dst_io|
270
270
  File.open file, "rb" do |src_io|
271
- dst_io.write src_io.read 16_384 until src_io.eof?
271
+ copy_stream(src_io, dst_io)
272
272
  end
273
273
  end
274
274
  end
@@ -453,7 +453,7 @@ EOM
453
453
  end
454
454
 
455
455
  if entry.file?
456
- File.open(destination, "wb") {|out| out.write entry.read }
456
+ File.open(destination, "wb") {|out| copy_stream(entry, out) }
457
457
  FileUtils.chmod file_mode(entry.header.mode), destination
458
458
  end
459
459
 
@@ -714,6 +714,16 @@ EOM
714
714
  rescue Zlib::GzipFile::Error => e
715
715
  raise Gem::Package::FormatError.new(e.message, entry.full_name)
716
716
  end
717
+
718
+ if RUBY_ENGINE == "truffleruby"
719
+ def copy_stream(src, dst) # :nodoc:
720
+ dst.write src.read
721
+ end
722
+ else
723
+ def copy_stream(src, dst) # :nodoc:
724
+ IO.copy_stream(src, dst)
725
+ end
726
+ end
717
727
  end
718
728
 
719
729
  require_relative "package/digest_io"
@@ -30,7 +30,7 @@ class Gem::Request
30
30
  @uri = uri
31
31
  @request_class = request_class
32
32
  @last_modified = last_modified
33
- @requests = Hash.new 0
33
+ @requests = Hash.new(0).compare_by_identity
34
34
  @user_agent = user_agent
35
35
 
36
36
  @connection_pool = pool
@@ -196,7 +196,7 @@ class Gem::Request
196
196
  bad_response = false
197
197
 
198
198
  begin
199
- @requests[connection.object_id] += 1
199
+ @requests[connection] += 1
200
200
 
201
201
  verbose "#{request.method} #{Gem::Uri.redact(@uri)}"
202
202
 
@@ -247,7 +247,7 @@ class Gem::Request
247
247
  rescue EOFError, Gem::Timeout::Error,
248
248
  Errno::ECONNABORTED, Errno::ECONNRESET, Errno::EPIPE
249
249
 
250
- requests = @requests[connection.object_id]
250
+ requests = @requests[connection]
251
251
  verbose "connection reset after #{requests} requests, retrying"
252
252
 
253
253
  raise Gem::RemoteFetcher::FetchError.new("too many connection resets", @uri) if retried
@@ -267,7 +267,7 @@ class Gem::Request
267
267
  # Resets HTTP connection +connection+.
268
268
 
269
269
  def reset(connection)
270
- @requests.delete connection.object_id
270
+ @requests.delete connection
271
271
 
272
272
  connection.finish
273
273
  connection.start
@@ -133,6 +133,14 @@ module Gem
133
133
  end
134
134
  attr_reader :sign, :data
135
135
  end
136
+
137
+ class UserClass < Element
138
+ def initialize(name, wrapped_object)
139
+ @name = name
140
+ @wrapped_object = wrapped_object
141
+ end
142
+ attr_reader :name, :wrapped_object
143
+ end
136
144
  end
137
145
  end
138
146
  end
@@ -299,7 +299,9 @@ module Gem
299
299
  end
300
300
 
301
301
  def read_user_class
302
- raise NotImplementedError, "Reading Marshal objects of type user_class is not implemented"
302
+ name = read_element
303
+ wrapped_object = read_element
304
+ Elements::UserClass.new(name, wrapped_object)
303
305
  end
304
306
  end
305
307
  end
@@ -247,6 +247,30 @@ module Gem::SafeMarshal
247
247
  end
248
248
  end
249
249
 
250
+ def visit_Gem_SafeMarshal_Elements_UserClass(r)
251
+ if resolve_class(r.name) == ::Hash && r.wrapped_object.is_a?(Elements::Hash)
252
+
253
+ hash = register_object({}.compare_by_identity)
254
+
255
+ o = r.wrapped_object
256
+ o.pairs.each_with_index do |(k, v), i|
257
+ push_stack i
258
+ k = visit(k)
259
+ push_stack k
260
+ hash[k] = visit(v)
261
+ end
262
+
263
+ if o.is_a?(Elements::HashWithDefaultValue)
264
+ push_stack :default
265
+ hash.default = visit(o.default)
266
+ end
267
+
268
+ hash
269
+ else
270
+ raise UnsupportedError.new("Unsupported user class #{resolve_class(r.name)} in marshal stream", stack: formatted_stack)
271
+ end
272
+ end
273
+
250
274
  def resolve_class(n)
251
275
  @class_cache[n] ||= begin
252
276
  to_s = resolve_symbol_name(n)
@@ -375,6 +399,12 @@ module Gem::SafeMarshal
375
399
  end
376
400
  end
377
401
 
402
+ class UnsupportedError < Error
403
+ def initialize(message, stack:)
404
+ super "#{message} @ #{stack.join "."}"
405
+ end
406
+ end
407
+
378
408
  class FormatError < Error
379
409
  end
380
410
 
data/lib/rubygems.rb CHANGED
@@ -9,7 +9,7 @@
9
9
  require "rbconfig"
10
10
 
11
11
  module Gem
12
- VERSION = "3.5.1"
12
+ VERSION = "3.5.3"
13
13
  end
14
14
 
15
15
  # Must be first since it unloads the prelude from 1.9.2
@@ -942,6 +942,13 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
942
942
  end].compact.uniq
943
943
  end
944
944
 
945
+ ##
946
+ # Suffixes for dynamic library require-able paths.
947
+
948
+ def self.dynamic_library_suffixes
949
+ @dynamic_library_suffixes ||= suffixes - [".rb"]
950
+ end
951
+
945
952
  ##
946
953
  # Prints the amount of time the supplied block takes to run using the debug
947
954
  # UI output.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.5.1"
5
+ s.version = "3.5.3"
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
 
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.5.1
4
+ version: 3.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: exe
18
18
  cert_chain: []
19
- date: 2023-12-15 00:00:00.000000000 Z
19
+ date: 2023-12-22 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
@@ -395,7 +395,6 @@ files:
395
395
  - bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb
396
396
  - bundler/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb
397
397
  - bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb
398
- - bundler/lib/bundler/vendor/thor/lib/thor/shell/lcs_diff.rb
399
398
  - bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb
400
399
  - bundler/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb
401
400
  - bundler/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb
@@ -703,7 +702,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
703
702
  - !ruby/object:Gem::Version
704
703
  version: '0'
705
704
  requirements: []
706
- rubygems_version: 3.5.1
705
+ rubygems_version: 3.5.3
707
706
  signing_key:
708
707
  specification_version: 4
709
708
  summary: RubyGems is a package management framework for Ruby. This gem is downloaded
@@ -1,49 +0,0 @@
1
- module LCSDiff
2
- protected
3
-
4
- # Overwrite show_diff to show diff with colors if Diff::LCS is
5
- # available.
6
- def show_diff(destination, content) #:nodoc:
7
- if diff_lcs_loaded? && ENV["THOR_DIFF"].nil? && ENV["RAILS_DIFF"].nil?
8
- actual = File.binread(destination).to_s.split("\n")
9
- content = content.to_s.split("\n")
10
-
11
- Diff::LCS.sdiff(actual, content).each do |diff|
12
- output_diff_line(diff)
13
- end
14
- else
15
- super
16
- end
17
- end
18
-
19
- private
20
-
21
- def output_diff_line(diff) #:nodoc:
22
- case diff.action
23
- when "-"
24
- say "- #{diff.old_element.chomp}", :red, true
25
- when "+"
26
- say "+ #{diff.new_element.chomp}", :green, true
27
- when "!"
28
- say "- #{diff.old_element.chomp}", :red, true
29
- say "+ #{diff.new_element.chomp}", :green, true
30
- else
31
- say " #{diff.old_element.chomp}", nil, true
32
- end
33
- end
34
-
35
- # Check if Diff::LCS is loaded. If it is, use it to create pretty output
36
- # for diff.
37
- def diff_lcs_loaded? #:nodoc:
38
- return true if defined?(Diff::LCS)
39
- return @diff_lcs_loaded unless @diff_lcs_loaded.nil?
40
-
41
- @diff_lcs_loaded = begin
42
- require "diff/lcs"
43
- true
44
- rescue LoadError
45
- false
46
- end
47
- end
48
-
49
- end