From 175ca909ee1a5b57aa0cae2c879920511f311b14 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 7 Oct 2017 00:31:28 +0200 Subject: Clean up code style and remove `.rubocop_todo.yml`. --- Library/Homebrew/patch.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Library/Homebrew/patch.rb') diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index 7045adf5e..8a1b00930 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -60,8 +60,7 @@ class EmbeddedPatch false end - def contents - end + def contents; end def apply data = contents.gsub("HOMEBREW_PREFIX", HOMEBREW_PREFIX) @@ -87,10 +86,13 @@ class DATAPatch < EmbeddedPatch def contents data = "" path.open("rb") do |f| - begin + loop do line = f.gets - end until line.nil? || line =~ /^__END__$/ - data << line while line = f.gets + break if line.nil? || line =~ /^__END__$/ + end + while line = f.gets + data << line + end end data end -- cgit v1.2.3