info: Fix style: Use a guard clause

Fix the style error:
Library/Homebrew/cmd/info.rb:88:7: C:
Use a guard clause instead of wrapping the code inside a conditional expression.
This commit is contained in:
Shaun Jackman 2019-01-04 09:43:51 -08:00
parent 930f7b90dc
commit d5b2415c87

View File

@ -85,11 +85,8 @@ module Homebrew
def info
info_args.parse
if args.json
if args.json == "v1" || args.json == true
raise UsageError, "invalid JSON version: #{args.json}" unless ["v1", true].include? args.json
print_json
else
raise UsageError, "invalid JSON version: #{args.json}"
end
elsif args.github?
exec_browser(*ARGV.formulae.map { |f| github_info(f) })
else