From 106d1749c965b8af857c976197814707b66cbef0 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 10:43:29 -0500 Subject: Fix issues reported by fasterer --- lib/diff/lcs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/diff/lcs.rb') diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index 288cfc2..234fd03 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -145,7 +145,7 @@ class << Diff::LCS matches = Diff::LCS::Internals.lcs(seq1, seq2) ret = [] string = seq1.kind_of? String - matches.each_with_index do |_e, i| + matches.each_index do |i| next if matches[i].nil? v = string ? seq1[i, 1] : seq1[i] -- cgit v1.2.1 From f85ec381137c6838600b16c353ff9dba3a05452c Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 10:44:44 -0500 Subject: standardrb --only Style/StringLiterals --fix --- lib/diff/lcs.rb | 64 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'lib/diff/lcs.rb') diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index 234fd03..e6d817b 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -49,11 +49,11 @@ module Diff; end unless defined? Diff # rubocop:disable Style/Documentation # a x b y c z p d q # a b c a x b y c z module Diff::LCS - VERSION = '1.5.0' + VERSION = "1.5.0" end -require 'diff/lcs/callbacks' -require 'diff/lcs/internals' +require "diff/lcs/callbacks" +require "diff/lcs/internals" module Diff::LCS # rubocop:disable Style/Documentation # Returns an Array containing the longest common subsequence(s) between @@ -299,7 +299,7 @@ class << Diff::LCS ax = string ? seq1[ai, 1] : seq1[ai] bx = string ? seq2[bj, 1] : seq2[bj] - event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("-", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_a(event) end @@ -310,13 +310,13 @@ class << Diff::LCS break unless bj < b_line bx = string ? seq2[bj, 1] : seq2[bj] - event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("+", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_b(event) bj += 1 end bx = string ? seq2[bj, 1] : seq2[bj] - event = Diff::LCS::ContextChange.new('=', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("=", ai, ax, bj, bx) event = yield event if block_given? callbacks.match(event) bj += 1 @@ -332,7 +332,7 @@ class << Diff::LCS if callbacks.respond_to?(:finished_a) and !run_finished_a ax = string ? seq1[-1, 1] : seq1[-1] bx = string ? seq2[bj, 1] : seq2[bj] - event = Diff::LCS::ContextChange.new('>', (a_size - 1), ax, bj, bx) + event = Diff::LCS::ContextChange.new(">", (a_size - 1), ax, bj, bx) event = yield event if block_given? callbacks.finished_a(event) run_finished_a = true @@ -340,7 +340,7 @@ class << Diff::LCS ax = string ? seq1[ai, 1] : seq1[ai] loop do bx = string ? seq2[bj, 1] : seq2[bj] - event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("+", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_b(event) bj += 1 @@ -354,7 +354,7 @@ class << Diff::LCS if callbacks.respond_to?(:finished_b) and !run_finished_b ax = string ? seq1[ai, 1] : seq1[ai] bx = string ? seq2[-1, 1] : seq2[-1] - event = Diff::LCS::ContextChange.new('<', ai, ax, (b_size - 1), bx) + event = Diff::LCS::ContextChange.new("<", ai, ax, (b_size - 1), bx) event = yield event if block_given? callbacks.finished_b(event) run_finished_b = true @@ -362,7 +362,7 @@ class << Diff::LCS bx = string ? seq2[bj, 1] : seq2[bj] loop do ax = string ? seq1[ai, 1] : seq1[ai] - event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("-", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_a(event) ai += 1 @@ -374,7 +374,7 @@ class << Diff::LCS if ai < a_size ax = string ? seq1[ai, 1] : seq1[ai] bx = string ? seq2[bj, 1] : seq2[bj] - event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("-", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_a(event) ai += 1 @@ -383,7 +383,7 @@ class << Diff::LCS if bj < b_size ax = string ? seq1[ai, 1] : seq1[ai] bx = string ? seq2[bj, 1] : seq2[bj] - event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("+", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_b(event) bj += 1 @@ -500,29 +500,29 @@ class << Diff::LCS case [(ai < ma), (bj < mb)] when [true, true] if callbacks.respond_to?(:change) - event = Diff::LCS::ContextChange.new('!', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("!", ai, ax, bj, bx) event = yield event if block_given? callbacks.change(event) ai += 1 else - event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("-", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_a(event) ai += 1 ax = string ? seq1[ai, 1] : seq1[ai] - event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("+", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_b(event) end bj += 1 when [true, false] - event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("-", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_a(event) ai += 1 when [false, true] - event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("+", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_b(event) bj += 1 @@ -532,7 +532,7 @@ class << Diff::LCS # Match ax = string ? seq1[ai, 1] : seq1[ai] bx = string ? seq2[bj, 1] : seq2[bj] - event = Diff::LCS::ContextChange.new('=', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("=", ai, ax, bj, bx) event = yield event if block_given? callbacks.match(event) ai += 1 @@ -546,29 +546,29 @@ class << Diff::LCS case [(ai < a_size), (bj < b_size)] when [true, true] if callbacks.respond_to?(:change) - event = Diff::LCS::ContextChange.new('!', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("!", ai, ax, bj, bx) event = yield event if block_given? callbacks.change(event) ai += 1 else - event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("-", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_a(event) ai += 1 ax = string ? seq1[ai, 1] : seq1[ai] - event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("+", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_b(event) end bj += 1 when [true, false] - event = Diff::LCS::ContextChange.new('-', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("-", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_a(event) ai += 1 when [false, true] - event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx) + event = Diff::LCS::ContextChange.new("+", ai, ax, bj, bx) event = yield event if block_given? callbacks.discard_b(event) bj += 1 @@ -577,8 +577,8 @@ class << Diff::LCS end PATCH_MAP = { #:nodoc: - :patch => { '+' => '+', '-' => '-', '!' => '!', '=' => '=' }.freeze, - :unpatch => { '+' => '-', '-' => '+', '!' => '!', '=' => '=' }.freeze + :patch => { "+" => "+", "-" => "-", "!" => "!", "=" => "=" }.freeze, + :unpatch => { "+" => "-", "-" => "+", "!" => "!", "=" => "=" }.freeze }.freeze # Applies a +patchset+ to the sequence +src+ according to the +direction+ @@ -655,14 +655,14 @@ class << Diff::LCS end case action - when '-' # Remove details from the old string + when "-" # Remove details from the old string while ai < op res << (string ? src[ai, 1] : src[ai]) ai += 1 bj += 1 end ai += 1 - when '+' + when "+" while bj < np res << (string ? src[ai, 1] : src[ai]) ai += 1 @@ -671,7 +671,7 @@ class << Diff::LCS res << el bj += 1 - when '=' + when "=" # This only appears in sdiff output with the SDiff callback. # Therefore, we only need to worry about dealing with a single # element. @@ -679,7 +679,7 @@ class << Diff::LCS ai += 1 bj += 1 - when '!' + when "!" while ai < op res << (string ? src[ai, 1] : src[ai]) ai += 1 @@ -693,14 +693,14 @@ class << Diff::LCS end when Diff::LCS::Change case action - when '-' + when "-" while ai < change.position res << (string ? src[ai, 1] : src[ai]) ai += 1 bj += 1 end ai += 1 - when '+' + when "+" while bj < change.position res << (string ? src[ai, 1] : src[ai]) ai += 1 @@ -736,4 +736,4 @@ class << Diff::LCS end end -require 'diff/lcs/backports' +require "diff/lcs/backports" -- cgit v1.2.1 From 22303f04b44d97455b5c862176d2d93c02a2b2ba Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 10:58:14 -0500 Subject: Fix Style/AndOr --- lib/diff/lcs.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/diff/lcs.rb') diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index e6d817b..bd0147e 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -326,10 +326,10 @@ class << Diff::LCS # The last entry (if any) processed was a match. +ai+ and +bj+ point just # past the last matching lines in their sequences. - while (ai < a_size) or (bj < b_size) + while (ai < a_size) || (bj < b_size) # last A? - if ai == a_size and bj < b_size - if callbacks.respond_to?(:finished_a) and !run_finished_a + if ai == a_size && bj < b_size + if callbacks.respond_to?(:finished_a) && !run_finished_a ax = string ? seq1[-1, 1] : seq1[-1] bx = string ? seq2[bj, 1] : seq2[bj] event = Diff::LCS::ContextChange.new(">", (a_size - 1), ax, bj, bx) @@ -350,8 +350,8 @@ class << Diff::LCS end # last B? - if bj == b_size and ai < a_size - if callbacks.respond_to?(:finished_b) and !run_finished_b + if bj == b_size && ai < a_size + if callbacks.respond_to?(:finished_b) && !run_finished_b ax = string ? seq1[ai, 1] : seq1[ai] bx = string ? seq2[-1, 1] : seq2[-1] event = Diff::LCS::ContextChange.new("<", ai, ax, (b_size - 1), bx) @@ -485,7 +485,7 @@ class << Diff::LCS # Find next match indices +ma+ and +mb+ loop do ma += 1 - break unless ma < matches.size and matches[ma].nil? + break unless ma < matches.size && matches[ma].nil? end break if ma >= matches.size # end of matches? @@ -493,7 +493,7 @@ class << Diff::LCS mb = matches[ma] # Change(seq2) - while (ai < ma) or (bj < mb) + while (ai < ma) || (bj < mb) ax = string ? seq1[ai, 1] : seq1[ai] bx = string ? seq2[bj, 1] : seq2[bj] @@ -539,7 +539,7 @@ class << Diff::LCS bj += 1 end - while (ai < a_size) or (bj < b_size) + while (ai < a_size) || (bj < b_size) ax = string ? seq1[ai, 1] : seq1[ai] bx = string ? seq2[bj, 1] : seq2[bj] -- cgit v1.2.1 From 5da19290c4b33f579f3b176192b7b15c151bdd00 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:02:38 -0500 Subject: Fix :yields: directive for rdoc --- lib/diff/lcs.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/diff/lcs.rb') diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index bd0147e..db2b03d 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -67,7 +67,7 @@ module Diff::LCS # rubocop:disable Style/Documentation # identically for key purposes. That is: # # O.new('a').eql?(O.new('a')) == true - def lcs(other, &block) #:yields self[i] if there are matched subsequences: + def lcs(other, &block) #:yields: self[i] if there are matched subsequences Diff::LCS.lcs(self, other, &block) end @@ -141,7 +141,7 @@ module Diff::LCS # rubocop:disable Style/Documentation end class << Diff::LCS - def lcs(seq1, seq2, &block) #:yields seq1[i] for each matched: + def lcs(seq1, seq2, &block) #:yields: seq1[i] for each matched matches = Diff::LCS::Internals.lcs(seq1, seq2) ret = [] string = seq1.kind_of? String @@ -165,7 +165,7 @@ class << Diff::LCS # Class argument is provided for +callbacks+, #diff will attempt to # initialise it. If the +callbacks+ object (possibly initialised) responds to # #finish, it will be called. - def diff(seq1, seq2, callbacks = nil, &block) # :yields diff changes: + def diff(seq1, seq2, callbacks = nil, &block) # :yields: diff changes diff_traversal(:diff, seq1, seq2, callbacks || Diff::LCS::DiffCallbacks, &block) end @@ -197,7 +197,7 @@ class << Diff::LCS # # insert # end # end - def sdiff(seq1, seq2, callbacks = nil, &block) #:yields diff changes: + def sdiff(seq1, seq2, callbacks = nil, &block) #:yields: diff changes diff_traversal(:sdiff, seq1, seq2, callbacks || Diff::LCS::SDiffCallbacks, &block) end @@ -282,7 +282,7 @@ class << Diff::LCS # callbacks#discard_b will be called after the end of the sequence # is reached, if +a+ has not yet reached the end of +A+ or +b+ has not yet # reached the end of +B+. - def traverse_sequences(seq1, seq2, callbacks = Diff::LCS::SequenceCallbacks) #:yields change events: + def traverse_sequences(seq1, seq2, callbacks = Diff::LCS::SequenceCallbacks) #:yields: change events callbacks ||= Diff::LCS::SequenceCallbacks matches = Diff::LCS::Internals.lcs(seq1, seq2) -- cgit v1.2.1 From 396a82c4d56bc0067c86de7cd32a4ae75f292c41 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:03:11 -0500 Subject: standardrb --only Layout/LeadingCommentSpace --fix --- lib/diff/lcs.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/diff/lcs.rb') diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index db2b03d..031e2d7 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -67,7 +67,7 @@ module Diff::LCS # rubocop:disable Style/Documentation # identically for key purposes. That is: # # O.new('a').eql?(O.new('a')) == true - def lcs(other, &block) #:yields: self[i] if there are matched subsequences + def lcs(other, &block) # :yields: self[i] if there are matched subsequences Diff::LCS.lcs(self, other, &block) end @@ -141,7 +141,7 @@ module Diff::LCS # rubocop:disable Style/Documentation end class << Diff::LCS - def lcs(seq1, seq2, &block) #:yields: seq1[i] for each matched + def lcs(seq1, seq2, &block) # :yields: seq1[i] for each matched matches = Diff::LCS::Internals.lcs(seq1, seq2) ret = [] string = seq1.kind_of? String @@ -197,7 +197,7 @@ class << Diff::LCS # # insert # end # end - def sdiff(seq1, seq2, callbacks = nil, &block) #:yields: diff changes + def sdiff(seq1, seq2, callbacks = nil, &block) # :yields: diff changes diff_traversal(:sdiff, seq1, seq2, callbacks || Diff::LCS::SDiffCallbacks, &block) end @@ -282,7 +282,7 @@ class << Diff::LCS # callbacks#discard_b will be called after the end of the sequence # is reached, if +a+ has not yet reached the end of +A+ or +b+ has not yet # reached the end of +B+. - def traverse_sequences(seq1, seq2, callbacks = Diff::LCS::SequenceCallbacks) #:yields: change events + def traverse_sequences(seq1, seq2, callbacks = Diff::LCS::SequenceCallbacks) # :yields: change events callbacks ||= Diff::LCS::SequenceCallbacks matches = Diff::LCS::Internals.lcs(seq1, seq2) @@ -576,7 +576,7 @@ class << Diff::LCS end end - PATCH_MAP = { #:nodoc: + PATCH_MAP = { # :nodoc: :patch => { "+" => "+", "-" => "-", "!" => "!", "=" => "=" }.freeze, :unpatch => { "+" => "-", "-" => "+", "!" => "!", "=" => "=" }.freeze }.freeze -- cgit v1.2.1 From 927b9b3c935f08a1611059e81b411c2ee2ff9724 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:13:21 -0500 Subject: Ignore Style/HashSyntax --- lib/diff/lcs.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/diff/lcs.rb') diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index 031e2d7..4461af0 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -576,10 +576,12 @@ class << Diff::LCS end end + # standard:disable Style/HashSyntax PATCH_MAP = { # :nodoc: :patch => { "+" => "+", "-" => "-", "!" => "!", "=" => "=" }.freeze, :unpatch => { "+" => "-", "-" => "+", "!" => "!", "=" => "=" }.freeze }.freeze + # standard:enable Style/HashSyntax # Applies a +patchset+ to the sequence +src+ according to the +direction+ # (:patch or :unpatch), producing a new sequence. -- cgit v1.2.1 From 99af1369a86b38585f6c63e9d50ac7040932916a Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:14:10 -0500 Subject: standardrb --only Style/ClassCheck --fix --- lib/diff/lcs.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/diff/lcs.rb') diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index 4461af0..2214240 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -144,7 +144,7 @@ class << Diff::LCS def lcs(seq1, seq2, &block) # :yields: seq1[i] for each matched matches = Diff::LCS::Internals.lcs(seq1, seq2) ret = [] - string = seq1.kind_of? String + string = seq1.is_a? String matches.each_index do |i| next if matches[i].nil? @@ -287,7 +287,7 @@ class << Diff::LCS matches = Diff::LCS::Internals.lcs(seq1, seq2) run_finished_a = run_finished_b = false - string = seq1.kind_of?(String) + string = seq1.is_a?(String) a_size = seq1.size b_size = seq2.size @@ -478,7 +478,7 @@ class << Diff::LCS b_size = seq2.size ai = bj = mb = 0 ma = -1 - string = seq1.kind_of?(String) + string = seq1.is_a?(String) # Process all the lines in the match vector. loop do @@ -629,7 +629,7 @@ class << Diff::LCS return src.respond_to?(:dup) ? src.dup : src unless has_changes - string = src.kind_of?(String) + string = src.is_a?(String) # Start with a new empty type of the source's class res = src.class.new -- cgit v1.2.1 From 63bb988f761da3fa061c9e3b5d13785477bf44c5 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:14:33 -0500 Subject: standardrb --only Layout/SpaceInsideHashLiteralBraces --fix --- lib/diff/lcs.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/diff/lcs.rb') diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index 2214240..77b508f 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -578,8 +578,8 @@ class << Diff::LCS # standard:disable Style/HashSyntax PATCH_MAP = { # :nodoc: - :patch => { "+" => "+", "-" => "-", "!" => "!", "=" => "=" }.freeze, - :unpatch => { "+" => "-", "-" => "+", "!" => "!", "=" => "=" }.freeze + :patch => {"+" => "+", "-" => "-", "!" => "!", "=" => "="}.freeze, + :unpatch => {"+" => "-", "-" => "+", "!" => "!", "=" => "="}.freeze }.freeze # standard:enable Style/HashSyntax -- cgit v1.2.1 From 7d087cc973685105e2bc1c69dca60d719138dcbc Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:25:24 -0500 Subject: Clean up lint directives --- lib/diff/lcs.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/diff/lcs.rb') diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index 77b508f..30385f8 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Diff; end unless defined? Diff # rubocop:disable Style/Documentation +module Diff; end unless defined? Diff # == How Diff Works (by Mark-Jason Dominus) # @@ -55,7 +55,7 @@ end require "diff/lcs/callbacks" require "diff/lcs/internals" -module Diff::LCS # rubocop:disable Style/Documentation +module Diff::LCS # Returns an Array containing the longest common subsequence(s) between # +self+ and +other+. See Diff::LCS#lcs. # -- cgit v1.2.1 From b160187f3d94f84b38faadb0726f7b0ae773d7eb Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:25:43 -0500 Subject: standardrb --only Style/Alias --fix --- lib/diff/lcs.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/diff/lcs.rb') diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index 30385f8..54ef893 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -101,7 +101,7 @@ module Diff::LCS def patch(patchset) Diff::LCS.patch(self, patchset) end - alias unpatch patch + alias_method :unpatch, :patch # Attempts to patch +self+ with the provided +patchset+. A new sequence based # on +self+ and the +patchset+ will be created. See Diff::LCS#patch. Does no @@ -154,7 +154,7 @@ class << Diff::LCS end ret end - alias LCS lcs + alias_method :LCS, :lcs # #diff computes the smallest set of additions and deletions necessary to # turn the first sequence into the second, and returns a description of these -- cgit v1.2.1