diff options
| author | Markus Reiter | 2017-10-08 20:38:32 +0200 |
|---|---|---|
| committer | GitHub | 2017-10-08 20:38:32 +0200 |
| commit | b806a53d88938ab2d2aeb5e96651ed6d47efcdf9 (patch) | |
| tree | 067464b4c08f4c16ca3439b533f06669a78c370c /Library/Homebrew/patch.rb | |
| parent | 91ab116ace7f4f97d3440190463c93be9ec6d675 (diff) | |
| parent | 175ca909ee1a5b57aa0cae2c879920511f311b14 (diff) | |
| download | brew-b806a53d88938ab2d2aeb5e96651ed6d47efcdf9.tar.bz2 | |
Merge pull request #3278 from reitermarkus/code-style
Clean up code style and remove `.rubocop_todo.yml`.
Diffstat (limited to 'Library/Homebrew/patch.rb')
| -rw-r--r-- | Library/Homebrew/patch.rb | 12 |
1 files changed, 7 insertions, 5 deletions
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 |
