summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2021-12-23 11:25:43 -0500
committerAustin Ziegler <austin@zieglers.ca>2022-07-04 20:26:10 -0400
commitb160187f3d94f84b38faadb0726f7b0ae773d7eb (patch)
tree3fadefafeb60cdbb3f6b5fb85fa2c53a8d058cad
parent7d087cc973685105e2bc1c69dca60d719138dcbc (diff)
downloaddiff-lcs-b160187f3d94f84b38faadb0726f7b0ae773d7eb.tar.gz
standardrb --only Style/Alias --fix
-rw-r--r--lib/diff/lcs.rb4
-rw-r--r--lib/diff/lcs/change.rb4
-rw-r--r--lib/diff/lcs/hunk.rb2
3 files changed, 5 insertions, 5 deletions
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
diff --git a/lib/diff/lcs/change.rb b/lib/diff/lcs/change.rb
index cebd3af..c86f102 100644
--- a/lib/diff/lcs/change.rb
+++ b/lib/diff/lcs/change.rb
@@ -39,7 +39,7 @@ class Diff::LCS::Change
[@action, @position, @element]
end
- alias to_ary to_a
+ alias_method :to_ary, :to_a
def self.from_a(arr)
arr = arr.flatten(1)
@@ -127,7 +127,7 @@ class Diff::LCS::ContextChange < Diff::LCS::Change
]
end
- alias to_ary to_a
+ alias_method :to_ary, :to_a
def self.from_a(arr)
Diff::LCS::Change.from_a(arr)
diff --git a/lib/diff/lcs/hunk.rb b/lib/diff/lcs/hunk.rb
index 9f596f3..7f97a7d 100644
--- a/lib/diff/lcs/hunk.rb
+++ b/lib/diff/lcs/hunk.rb
@@ -102,7 +102,7 @@ class Diff::LCS::Hunk
@start_new = hunk.start_new
blocks.unshift(*hunk.blocks)
end
- alias unshift merge
+ alias_method :unshift, :merge
# Determines whether there is an overlap between this hunk and the
# provided hunk. This will be true if the difference between the two hunks