Skip to content

Commit

Permalink
Fix :yields: directive for rdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Jul 5, 2022
1 parent 22303f0 commit 5da1929
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/diff/lcs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -141,7 +141,7 @@ def unpatch_me(patchset)
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
Expand All @@ -165,7 +165,7 @@ def lcs(seq1, seq2, &block) #:yields seq1[i] for each matched:
# 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

Expand Down Expand Up @@ -197,7 +197,7 @@ def diff(seq1, seq2, callbacks = nil, &block) # :yields diff changes:
# # 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

Expand Down Expand Up @@ -282,7 +282,7 @@ def sdiff(seq1, seq2, callbacks = nil, &block) #:yields diff changes:
# <tt>callbacks#discard_b</tt> 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)

Expand Down
4 changes: 2 additions & 2 deletions lib/diff/lcs/callbacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5da1929

Please sign in to comment.