aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/gist-logs.rb
diff options
context:
space:
mode:
authorMarkus Reiter2016-11-13 23:37:40 +0100
committerMarkus Reiter2016-11-13 23:37:40 +0100
commit59e2d6772158d8df0735708ae78ddec6ccc68026 (patch)
tree5f229d5a65884cf040c21cd4c20f1be1629dd5c5 /Library/Homebrew/cmd/gist-logs.rb
parentc648518f35611b16dfdd1355b2c8498d7f6d54d7 (diff)
downloadbrew-59e2d6772158d8df0735708ae78ddec6ccc68026.tar.bz2
No if/unless-modifier on multiline blocks.
Diffstat (limited to 'Library/Homebrew/cmd/gist-logs.rb')
-rw-r--r--Library/Homebrew/cmd/gist-logs.rb16
1 files changed, 9 insertions, 7 deletions
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