diff options
| author | Jack Nagel | 2014-09-07 16:10:40 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-09-07 16:12:02 -0500 |
| commit | 64f07b8ffef70954c87b398d9cfd7163112d95f1 (patch) | |
| tree | 8e40406e05f7c2459731caee51de6b7325b09f35 /Library | |
| parent | c72cf43f9fd1e1ff788145f875af1b13600ab9e3 (diff) | |
| download | homebrew-64f07b8ffef70954c87b398d9cfd7163112d95f1.tar.bz2 | |
gist-logs: pull ternary out of hash literal
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/cmd/brew-gist-logs.rb | 5 |
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 |
