diff options
author | Austin Ziegler <austin@zieglers.ca> | 2021-12-23 10:44:44 -0500 |
---|---|---|
committer | Austin Ziegler <austin@zieglers.ca> | 2022-07-04 20:26:10 -0400 |
commit | f85ec381137c6838600b16c353ff9dba3a05452c (patch) | |
tree | 7a2718961e97c56d4c70dc0a6ebe6b17aee005fc /lib/diff/lcs/change.rb | |
parent | ef23b66e9a495206f2bf1cd9ce0df50d363d26ef (diff) | |
download | diff-lcs-f85ec381137c6838600b16c353ff9dba3a05452c.tar.gz |
standardrb --only Style/StringLiterals --fix
Diffstat (limited to 'lib/diff/lcs/change.rb')
-rw-r--r-- | lib/diff/lcs/change.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/diff/lcs/change.rb b/lib/diff/lcs/change.rb index 76faf83..aa55360 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.kind_of? IntClass end def inspect(*_args) @@ -49,7 +49,7 @@ class Diff::LCS::Change when 3 Diff::LCS::Change.new(*(arr[0...3])) else - fail 'Invalid change array format provided.' + fail "Invalid change array format provided." end end @@ -70,27 +70,27 @@ class Diff::LCS::Change end def adding? - @action == '+' + @action == "+" end def deleting? - @action == '-' + @action == "-" end def unchanged? - @action == '=' + @action == "=" end def changed? - @action == '!' + @action == "!" end def finished_a? - @action == '>' + @action == ">" end def finished_b? - @action == '<' + @action == "<" end end @@ -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? or @old_position.kind_of? IntClass - fail 'Invalid (New) Position Type' unless @new_position.nil? or @new_position.kind_of? IntClass + fail "Invalid (Old) Position Type" unless @old_position.nil? or @old_position.kind_of? IntClass + fail "Invalid (New) Position Type" unless @new_position.nil? or @new_position.kind_of? IntClass end def to_a @@ -139,15 +139,15 @@ class Diff::LCS::ContextChange < Diff::LCS::Change ea = event.to_a case ea[0] - when '-' + when "-" ea[2][1] = nil - when '<' - ea[0] = '-' + when "<" + ea[0] = "-" ea[2][1] = nil - when '+' + when "+" ea[1][1] = nil - when '>' - ea[0] = '+' + when ">" + ea[0] = "+" ea[1][1] = nil end |