aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-09-07 16:10:40 -0500
committerJack Nagel2014-09-07 16:12:02 -0500
commitc0c5298ae5cf12f4a058732072d55ba3a6a02d77 (patch)
tree78bb1270987c408b3b9b6d8894de24b8c1af2619 /Library
parent832f88fbc175d0a22bddfacaa8ccfa3734d962c8 (diff)
downloadbrew-c0c5298ae5cf12f4a058732072d55ba3a6a02d77.tar.bz2
gist-logs: pull ternary out of hash literal
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/cmd/brew-gist-logs.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/Library/Contributions/cmd/brew-gist-logs.rb b/Library/Contributions/cmd/brew-gist-logs.rb
index 67f7eaea4..d5f6bb3a6 100755
--- a/Library/Contributions/cmd/brew-gist-logs.rb
+++ b/Library/Contributions/cmd/brew-gist-logs.rb
@@ -29,9 +29,10 @@ end
def load_logs name
logs = {}
- dir = (HOMEBREW_LOGS/name)
+ dir = HOMEBREW_LOGS/name
dir.children.sort.each do |file|
- logs[file.basename.to_s] = {:content => (file.size == 0 ? "empty log" : file.read)}
+ contents = file.size? ? file.read : "empty log"
+ logs[file.basename.to_s] = { :content => contents }
end if dir.exist?
raise 'No logs.' if logs.empty?
logs