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 +++++----- lib/diff/lcs/callbacks.rb | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) 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) diff --git a/lib/diff/lcs/callbacks.rb b/lib/diff/lcs/callbacks.rb index c075327..54b3686 100644 --- a/lib/diff/lcs/callbacks.rb +++ b/lib/diff/lcs/callbacks.rb @@ -107,7 +107,7 @@ class Diff::LCS::DiffCallbacks # Returns the difference set collected during the diff process. attr_reader :diffs - def initialize # :yields self: + def initialize # :yields: self @hunk = [] @diffs = [] @@ -302,7 +302,7 @@ class Diff::LCS::SDiffCallbacks # Returns the difference set collected during the diff process. attr_reader :diffs - def initialize #:yields self: + def initialize #:yields: self @diffs = [] yield self if block_given? end -- cgit v1.2.1