aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/caveats.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-09-18 13:28:15 +0100
committerGitHub2016-09-18 13:28:15 +0100
commit59b7f16bfd9c1968aae0a2f1cd9a43d3d160d99f (patch)
tree17d2adec882cdeef36a8fd40d891fe7fe4021572 /Library/Homebrew/caveats.rb
parent56541001a45ea58c54096bc42584c17d72b1415a (diff)
parent1bdbb0f462e4c3557bbcba0b203696bdcf025bb4 (diff)
downloadbrew-59b7f16bfd9c1968aae0a2f1cd9a43d3d160d99f.tar.bz2
Merge pull request #989 from MikeMcQuaid/rubocop-final
Rubocop: apply auto-corrections and don't use hash-rockets
Diffstat (limited to 'Library/Homebrew/caveats.rb')
-rw-r--r--Library/Homebrew/caveats.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb
index b71596b2b..9c1787f87 100644
--- a/Library/Homebrew/caveats.rb
+++ b/Library/Homebrew/caveats.rb
@@ -8,9 +8,10 @@ class Caveats
def caveats
caveats = []
begin
- build, f.build = f.build, Tab.for_formula(f)
+ build = f.build
+ f.build = Tab.for_formula(f)
s = f.caveats.to_s
- caveats << s.chomp + "\n" if s.length > 0
+ caveats << s.chomp + "\n" unless s.empty?
ensure
f.build = build
end
@@ -33,7 +34,11 @@ class Caveats
def keg
@keg ||= [f.prefix, f.opt_prefix, f.linked_keg].map do |d|
- Keg.new(d.resolved_path) rescue nil
+ begin
+ Keg.new(d.resolved_path)
+ rescue
+ nil
+ end
end.compact.first
end