summaryrefslogtreecommitdiff
path: root/lib/diff/lcs
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2021-12-23 11:14:10 -0500
committerAustin Ziegler <austin@zieglers.ca>2022-07-04 20:26:10 -0400
commit99af1369a86b38585f6c63e9d50ac7040932916a (patch)
tree370f1bbc09632cd3a24c504815fa572e038b3e76 /lib/diff/lcs
parent927b9b3c935f08a1611059e81b411c2ee2ff9724 (diff)
downloaddiff-lcs-99af1369a86b38585f6c63e9d50ac7040932916a.tar.gz
standardrb --only Style/ClassCheck --fix
Diffstat (limited to 'lib/diff/lcs')
-rw-r--r--lib/diff/lcs/change.rb6
-rw-r--r--lib/diff/lcs/internals.rb8
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/diff/lcs/change.rb b/lib/diff/lcs/change.rb
index f20d804..cebd3af 100644
--- a/lib/diff/lcs/change.rb
+++ b/lib/diff/lcs/change.rb
@@ -28,7 +28,7 @@ class Diff::LCS::Change
@action, @position, @element = *args
fail "Invalid Change Action '#{@action}'" unless Diff::LCS::Change.valid_action?(@action)
- fail "Invalid Position Type" unless @position.kind_of? IntClass
+ fail "Invalid Position Type" unless @position.is_a? IntClass
end
def inspect(*_args)
@@ -115,8 +115,8 @@ class Diff::LCS::ContextChange < Diff::LCS::Change
@action, @old_position, @old_element, @new_position, @new_element = *args
fail "Invalid Change Action '#{@action}'" unless Diff::LCS::Change.valid_action?(@action)
- fail "Invalid (Old) Position Type" unless @old_position.nil? || @old_position.kind_of?(IntClass)
- fail "Invalid (New) Position Type" unless @new_position.nil? || @new_position.kind_of?(IntClass)
+ fail "Invalid (Old) Position Type" unless @old_position.nil? || @old_position.is_a?(IntClass)
+ fail "Invalid (New) Position Type" unless @new_position.nil? || @new_position.is_a?(IntClass)
end
def to_a
diff --git a/lib/diff/lcs/internals.rb b/lib/diff/lcs/internals.rb
index b968917..8a9160a 100644
--- a/lib/diff/lcs/internals.rb
+++ b/lib/diff/lcs/internals.rb
@@ -13,7 +13,7 @@ class << Diff::LCS
if block
callbacks.diffs.map do |hunk|
- if hunk.kind_of? Array
+ if hunk.is_a? Array
hunk.map { |hunk_block| block[hunk_block] }
else
block[hunk]
@@ -64,7 +64,7 @@ class << Diff::LCS::Internals
thresh = []
links = []
- string = a.kind_of?(String)
+ string = a.is_a?(String)
(a_start..a_finish).each do |i|
ai = string ? a[i, 1] : a[i]
@@ -145,7 +145,7 @@ class << Diff::LCS::Internals
# Diff::LCS::Change as its source, as an array will cause the creation
# of one of the above.
def intuit_diff_direction(src, patchset, limit = nil)
- string = src.kind_of?(String)
+ string = src.is_a?(String)
count = left_match = left_miss = right_match = right_miss = 0
patchset.each do |change|
@@ -296,7 +296,7 @@ enumerable as either source or destination value."
# positions it occupies in the Enumerable, optionally restricted to the
# elements specified in the range of indexes specified by +interval+.
def position_hash(enum, interval)
- string = enum.kind_of?(String)
+ string = enum.is_a?(String)
hash = Hash.new { |h, k| h[k] = [] }
interval.each do |i|
k = string ? enum[i, 1] : enum[i]