From 59e2d6772158d8df0735708ae78ddec6ccc68026 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 13 Nov 2016 23:37:40 +0100 Subject: No if/unless-modifier on multiline blocks. --- Library/Homebrew/cmd/gist-logs.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index 5cacd50b6..fecdc25a0 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -94,13 +94,15 @@ module Homebrew def load_logs(dir) logs = {} - dir.children.sort.each do |file| - contents = file.size? ? file.read : "empty log" - # small enough to avoid GitHub "unicorn" page-load-timeout errors - max_file_size = 1_000_000 - contents = truncate_text_to_approximate_size(contents, max_file_size, front_weight: 0.2) - logs[file.basename.to_s] = { content: contents } - end if dir.exist? + if dir.exist? + dir.children.sort.each do |file| + contents = file.size? ? file.read : "empty log" + # small enough to avoid GitHub "unicorn" page-load-timeout errors + max_file_size = 1_000_000 + contents = truncate_text_to_approximate_size(contents, max_file_size, front_weight: 0.2) + logs[file.basename.to_s] = { content: contents } + end + end raise "No logs." if logs.empty? logs end -- cgit v1.2.3