Replaced 'unless nil' with 'if'

This commit is contained in:
Zach Auten 2019-03-16 12:59:15 -04:00
parent 9eadee9408
commit e9b17b8593
2 changed files with 4 additions and 4 deletions

View File

@ -31,13 +31,13 @@ module Cask
output << Formatter.url(cask.homepage) + "\n" if cask.homepage output << Formatter.url(cask.homepage) + "\n" if cask.homepage
output << installation_info(cask) output << installation_info(cask)
repo = repo_info(cask) repo = repo_info(cask)
output << repo + "\n" unless repo.nil? output << repo + "\n" if repo
output << name_info(cask) output << name_info(cask)
language = language_info(cask) language = language_info(cask)
output << language unless language.nil? output << language if language
output << artifact_info(cask) + "\n" output << artifact_info(cask) + "\n"
caveats = Installer.caveats(cask) caveats = Installer.caveats(cask)
output << caveats unless caveats.nil? output << caveats if caveats
output output
end end

View File

@ -195,7 +195,7 @@ module Homebrew
cask = Cask::CaskLoader.load(name) cask = Cask::CaskLoader.load(name)
reason = "Found the following cask named \"#{name}\" instead:\n" reason = "Found the following cask named \"#{name}\" instead:\n"
reason << Cask::Cmd::Info.get_info(cask) unless silent reason << Cask::Cmd::Info.get_info(cask)
rescue Cask::CaskUnavailableError rescue Cask::CaskUnavailableError
nil nil
end end