From 52ff98853068c03b3bfa777932da1da69e35e583 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 20 Sep 2016 22:03:08 +0200 Subject: Fix RuboCop CaseEquality. --- Library/Homebrew/patch.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/patch.rb') diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index 1148389cf..74e58e526 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -89,7 +89,7 @@ class DATAPatch < EmbeddedPatch path.open("rb") do |f| begin line = f.gets - end until line.nil? || /^__END__$/ === line + end until line.nil? || line =~ /^__END__$/ data << line while line = f.gets end data -- cgit v1.2.3 From 58e36c73193befb57d351344cea2a4a33fef850d Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 23 Sep 2016 22:02:23 +0200 Subject: Fix Style/GuardClause. --- Library/Homebrew/patch.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Library/Homebrew/patch.rb') diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index 74e58e526..1b7751ba3 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -130,14 +130,13 @@ class ExternalPatch patch_dir = Pathname.pwd if patch_files.empty? children = patch_dir.children - if children.length == 1 && children.first.file? - patch_files << children.first.basename - else + if children.length != 1 || !children.first.file? raise MissingApplyError, <<-EOS.undent There should be exactly one patch file in the staging directory unless the "apply" method was used one or more times in the patch-do block. EOS end + patch_files << children.first.basename end dir.cd do patch_files.each do |patch_file| -- cgit v1.2.3