From f85ec381137c6838600b16c353ff9dba3a05452c Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 10:44:44 -0500 Subject: standardrb --only Style/StringLiterals --fix --- lib/diff/lcs/callbacks.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/diff/lcs/callbacks.rb') diff --git a/lib/diff/lcs/callbacks.rb b/lib/diff/lcs/callbacks.rb index 2a7665b..c075327 100644 --- a/lib/diff/lcs/callbacks.rb +++ b/lib/diff/lcs/callbacks.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'diff/lcs/change' +require "diff/lcs/change" module Diff::LCS # rubocop:disable Style/Documentation # This callback object implements the default set of callback events, @@ -131,11 +131,11 @@ class Diff::LCS::DiffCallbacks end def discard_a(event) - @hunk << Diff::LCS::Change.new('-', event.old_position, event.old_element) + @hunk << Diff::LCS::Change.new("-", event.old_position, event.old_element) end def discard_b(event) - @hunk << Diff::LCS::Change.new('+', event.new_position, event.new_element) + @hunk << Diff::LCS::Change.new("+", event.new_position, event.new_element) end def finish_hunk -- cgit v1.2.1 From 5da19290c4b33f579f3b176192b7b15c151bdd00 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:02:38 -0500 Subject: Fix :yields: directive for rdoc --- lib/diff/lcs/callbacks.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/diff/lcs/callbacks.rb') diff --git a/lib/diff/lcs/callbacks.rb b/lib/diff/lcs/callbacks.rb index c075327..54b3686 100644 --- a/lib/diff/lcs/callbacks.rb +++ b/lib/diff/lcs/callbacks.rb @@ -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 = [] @@ -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 -- cgit v1.2.1 From 396a82c4d56bc0067c86de7cd32a4ae75f292c41 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:03:11 -0500 Subject: standardrb --only Layout/LeadingCommentSpace --fix --- lib/diff/lcs/callbacks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/diff/lcs/callbacks.rb') diff --git a/lib/diff/lcs/callbacks.rb b/lib/diff/lcs/callbacks.rb index 54b3686..cdda2dd 100644 --- a/lib/diff/lcs/callbacks.rb +++ b/lib/diff/lcs/callbacks.rb @@ -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 -- cgit v1.2.1 From 7d087cc973685105e2bc1c69dca60d719138dcbc Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:25:24 -0500 Subject: Clean up lint directives --- lib/diff/lcs/callbacks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/diff/lcs/callbacks.rb') diff --git a/lib/diff/lcs/callbacks.rb b/lib/diff/lcs/callbacks.rb index cdda2dd..6fc229b 100644 --- a/lib/diff/lcs/callbacks.rb +++ b/lib/diff/lcs/callbacks.rb @@ -2,7 +2,7 @@ require "diff/lcs/change" -module Diff::LCS # rubocop:disable Style/Documentation +module Diff::LCS # This callback object implements the default set of callback events, # which only returns the event itself. Note that #finished_a and # #finished_b are not implemented -- I haven't yet figured out where they -- cgit v1.2.1 From a7e532ead1780f94d11bf42ac613b8428d808597 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:26:15 -0500 Subject: standardrb --only Style/RescueModifier --fix --- lib/diff/lcs/callbacks.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/diff/lcs/callbacks.rb') diff --git a/lib/diff/lcs/callbacks.rb b/lib/diff/lcs/callbacks.rb index 6fc229b..818c013 100644 --- a/lib/diff/lcs/callbacks.rb +++ b/lib/diff/lcs/callbacks.rb @@ -50,7 +50,11 @@ module Diff::LCS BalancedCallbacks = DefaultCallbacks def self.callbacks_for(callbacks) - callbacks.new rescue callbacks + begin + callbacks.new + rescue + callbacks + end end end -- cgit v1.2.1 From 8992d9c1c13f7852f23ef823257bcf9691049e56 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:31:46 -0500 Subject: standardrb --only Style/RedundantBegin --fix --- lib/diff/lcs/callbacks.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/diff/lcs/callbacks.rb') diff --git a/lib/diff/lcs/callbacks.rb b/lib/diff/lcs/callbacks.rb index 818c013..2c5a779 100644 --- a/lib/diff/lcs/callbacks.rb +++ b/lib/diff/lcs/callbacks.rb @@ -50,11 +50,9 @@ module Diff::LCS BalancedCallbacks = DefaultCallbacks def self.callbacks_for(callbacks) - begin - callbacks.new - rescue - callbacks - end + callbacks.new + rescue + callbacks end end -- cgit v1.2.1