From cb9bebb30477e815cdbe8f8460f227f0940599a1 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 10:45:50 -0500 Subject: standardrb --only Style/PercentLiteralDelimiters --fix --- Rakefile | 2 +- lib/diff/lcs/change.rb | 2 +- spec/issues_spec.rb | 4 ++-- spec/patch_spec.rb | 4 ++-- spec/sdiff_spec.rb | 42 +++++++++++++++++++++--------------------- spec/spec_helper.rb | 14 +++++++------- spec/traverse_balanced_spec.rb | 32 ++++++++++++++++---------------- 7 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Rakefile b/Rakefile index 18c1304..3924134 100644 --- a/Rakefile +++ b/Rakefile @@ -85,7 +85,7 @@ end desc "Run all specifications" RSpec::Core::RakeTask.new(:spec) do |t| - rspec_dirs = %w(spec lib).join(":") + rspec_dirs = %w[spec lib].join(":") t.rspec_opts = ["-I#{rspec_dirs}"] end diff --git a/lib/diff/lcs/change.rb b/lib/diff/lcs/change.rb index aa55360..a82f3e6 100644 --- a/lib/diff/lcs/change.rb +++ b/lib/diff/lcs/change.rb @@ -10,7 +10,7 @@ class Diff::LCS::Change # (no change), '!' (changed), '<' (tail changes from first sequence), or # '>' (tail changes from second sequence). The last two ('<>') are only # found with Diff::LCS::diff and Diff::LCS::sdiff. - VALID_ACTIONS = %w(+ - = ! > <).freeze + VALID_ACTIONS = %w[+ - = ! > <].freeze def self.valid_action?(action) VALID_ACTIONS.include? action diff --git a/spec/issues_spec.rb b/spec/issues_spec.rb index fedc3f5..abe524e 100644 --- a/spec/issues_spec.rb +++ b/spec/issues_spec.rb @@ -41,13 +41,13 @@ describe "Diff::LCS Issues" do end describe "array" do - it_has_behavior "handles simple diffs", %w(a X), %w(b X a X), [ + it_has_behavior "handles simple diffs", %w[a X], %w[b X a X], [ [ ["+", 0, "b"], ["+", 1, "X"] ] ] - it_has_behavior "handles simple diffs", %w(b X a X), %w(a X), [ + it_has_behavior "handles simple diffs", %w[b X a X], %w[a X], [ [ ["-", 0, "b"], ["-", 1, "X"] diff --git a/spec/patch_spec.rb b/spec/patch_spec.rb index 8c3a9b1..6b9bf28 100644 --- a/spec/patch_spec.rb +++ b/spec/patch_spec.rb @@ -181,8 +181,8 @@ describe "Diff::LCS.patch" do # above. describe "fix bug 891: patchsets do not contain the last equal part" do before :each do - @s1 = %w(a b c d e f g h i j k) # rubocop:disable Layout/SpaceInsideArrayPercentLiteral - @s2 = %w(a b c d D e f g h i j k) + @s1 = %w[a b c d e f g h i j k] # rubocop:disable Layout/SpaceInsideArrayPercentLiteral + @s2 = %w[a b c d D e f g h i j k] end describe "using Diff::LCS.diff with default diff callbacks" do diff --git a/spec/sdiff_spec.rb b/spec/sdiff_spec.rb index 6816833..9750519 100644 --- a/spec/sdiff_spec.rb +++ b/spec/sdiff_spec.rb @@ -24,8 +24,8 @@ describe "Diff::LCS.sdiff" do end describe "using %w(abc def yyy xxx ghi jkl) & %w(abc dxf xxx ghi jkl)" do - let(:s1) { %w(abc def yyy xxx ghi jkl) } - let(:s2) { %w(abc dxf xxx ghi jkl) } + let(:s1) { %w[abc def yyy xxx ghi jkl] } + let(:s2) { %w[abc dxf xxx ghi jkl] } let(:result) { [ ["=", [0, "abc"], [0, "abc"]], @@ -41,8 +41,8 @@ describe "Diff::LCS.sdiff" do end describe "using %w(a b c d e) & %w(a e)" do - let(:s1) { %w(a b c d e) } - let(:s2) { %w(a e) } + let(:s1) { %w[a b c d e] } + let(:s2) { %w[a e] } let(:result) { [ ["=", [0, "a"], [0, "a"]], @@ -57,8 +57,8 @@ describe "Diff::LCS.sdiff" do end describe "using %w(a e) & %w(a b c d e)" do - let(:s1) { %w(a e) } - let(:s2) { %w(a b c d e) } + let(:s1) { %w[a e] } + let(:s2) { %w[a b c d e] } let(:result) { [ ["=", [0, "a"], [0, "a"]], @@ -73,8 +73,8 @@ describe "Diff::LCS.sdiff" do end describe "using %w(v x a e) & %w(w y a b c d e)" do - let(:s1) { %w(v x a e) } - let(:s2) { %w(w y a b c d e) } + let(:s1) { %w[v x a e] } + let(:s2) { %w[w y a b c d e] } let(:result) { [ ["!", [0, "v"], [0, "w"]], @@ -91,8 +91,8 @@ describe "Diff::LCS.sdiff" do end describe "using %w(x a e) & %w(a b c d e)" do - let(:s1) { %w(x a e) } - let(:s2) { %w(a b c d e) } + let(:s1) { %w[x a e] } + let(:s2) { %w[a b c d e] } let(:result) { [ ["-", [0, "x"], [0, nil]], @@ -108,8 +108,8 @@ describe "Diff::LCS.sdiff" do end describe "using %w(a e) & %w(x a b c d e)" do - let(:s1) { %w(a e) } - let(:s2) { %w(x a b c d e) } + let(:s1) { %w[a e] } + let(:s2) { %w[x a b c d e] } let(:result) { [ ["+", [0, nil], [0, "x"]], @@ -125,8 +125,8 @@ describe "Diff::LCS.sdiff" do end describe "using %w(a e v) & %w(x a b c d e w x)" do - let(:s1) { %w(a e v) } - let(:s2) { %w(x a b c d e w x) } + let(:s1) { %w[a e v] } + let(:s2) { %w[x a b c d e w x] } let(:result) { [ ["+", [0, nil], [0, "x"]], @@ -144,8 +144,8 @@ describe "Diff::LCS.sdiff" do end describe "using %w() & %w(a b c)" do - let(:s1) { %w() } - let(:s2) { %w(a b c) } + let(:s1) { %w[] } + let(:s2) { %w[a b c] } let(:result) { [ ["+", [0, nil], [0, "a"]], @@ -158,8 +158,8 @@ describe "Diff::LCS.sdiff" do end describe "using %w(a b c) & %w(1)" do - let(:s1) { %w(a b c) } - let(:s2) { %w(1) } + let(:s1) { %w[a b c] } + let(:s2) { %w[1] } let(:result) { [ ["!", [0, "a"], [0, "1"]], @@ -172,8 +172,8 @@ describe "Diff::LCS.sdiff" do end describe "using %w(a b c) & %w(c)" do - let(:s1) { %w(a b c) } - let(:s2) { %w(c) } + let(:s1) { %w[a b c] } + let(:s2) { %w[c] } let(:result) { [ ["-", [0, "a"], [0, nil]], @@ -186,7 +186,7 @@ describe "Diff::LCS.sdiff" do end describe "using %w(abcd efgh ijkl mnop) & []" do - let(:s1) { %w(abcd efgh ijkl mnop) } + let(:s1) { %w[abcd efgh ijkl mnop] } let(:s2) { [] } let(:result) { [ diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 20f8c39..af5ec23 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -79,31 +79,31 @@ module Diff::LCS::SpecHelper end def hello_ary - %w(h e l l o) + %w[h e l l o] end def seq1 - %w(a b c e h j l m n p) + %w[a b c e h j l m n p] end def skipped_seq1 - %w(a h n p) + %w[a h n p] end def seq2 - %w(b c d e f j k l m r s t) + %w[b c d e f j k l m r s t] end def skipped_seq2 - %w(d f k r s t) + %w[d f k r s t] end def word_sequence - %w(abcd efgh ijkl mnopqrstuvwxyz) + %w[abcd efgh ijkl mnopqrstuvwxyz] end def correct_lcs - %w(b c e j l m) + %w[b c e j l m] end def correct_forward_diff diff --git a/spec/traverse_balanced_spec.rb b/spec/traverse_balanced_spec.rb index fcbde79..4956acf 100644 --- a/spec/traverse_balanced_spec.rb +++ b/spec/traverse_balanced_spec.rb @@ -43,7 +43,7 @@ describe "Diff::LCS.traverse_balanced" do end describe "identical array sequences %w(a b c)" do - s1 = s2 = %w(a b c) + s1 = s2 = %w[a b c] result = [ ["=", 0, 0], @@ -56,8 +56,8 @@ describe "Diff::LCS.traverse_balanced" do end describe "sequences %w(a b c) & %w(a x c)" do - s1 = %w(a b c) - s2 = %w(a x c) + s1 = %w[a b c] + s2 = %w[a x c] result = [ ["=", 0, 0], @@ -70,8 +70,8 @@ describe "Diff::LCS.traverse_balanced" do end describe "sequences %w(a x y c) & %w(a v w c)" do - s1 = %w(a x y c) - s2 = %w(a v w c) + s1 = %w[a x y c] + s2 = %w[a v w c] result = [ ["=", 0, 0], @@ -85,8 +85,8 @@ describe "Diff::LCS.traverse_balanced" do end describe "sequences %w(x y c) & %w(v w c)" do - s1 = %w(x y c) - s2 = %w(v w c) + s1 = %w[x y c] + s2 = %w[v w c] result = [ ["!", 0, 0], ["!", 1, 1], @@ -98,8 +98,8 @@ describe "Diff::LCS.traverse_balanced" do end describe "sequences %w(a x y z) & %w(b v w)" do - s1 = %w(a x y z) - s2 = %w(b v w) + s1 = %w[a x y z] + s2 = %w[b v w] result = [ ["!", 0, 0], ["!", 1, 1], @@ -112,8 +112,8 @@ describe "Diff::LCS.traverse_balanced" do end describe "sequences %w(a z) & %w(a)" do - s1 = %w(a z) - s2 = %w(a) + s1 = %w[a z] + s2 = %w[a] result = [ ["=", 0, 0], ["<", 1, 1] @@ -124,8 +124,8 @@ describe "Diff::LCS.traverse_balanced" do end describe "sequences %w(z a) & %w(a)" do - s1 = %w(z a) - s2 = %w(a) + s1 = %w[z a] + s2 = %w[a] result = [ ["<", 0, 0], ["=", 1, 0] @@ -136,8 +136,8 @@ describe "Diff::LCS.traverse_balanced" do end describe "sequences %w(a b c) & %w(x y z)" do - s1 = %w(a b c) - s2 = %w(x y z) + s1 = %w[a b c] + s2 = %w[x y z] result = [ ["!", 0, 0], ["!", 1, 1], @@ -149,7 +149,7 @@ describe "Diff::LCS.traverse_balanced" do end describe "sequences %w(abcd efgh ijkl mnoopqrstuvwxyz) & []" do - s1 = %w(abcd efgh ijkl mnopqrstuvwxyz) + s1 = %w[abcd efgh ijkl mnopqrstuvwxyz] s2 = [] result = [ ["<", 0, 0], -- cgit v1.2.1