From d5b2415c870e010a4283d5b5d0b5166514493636 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Fri, 4 Jan 2019 09:43:51 -0800 Subject: [PATCH] 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. --- Library/Homebrew/cmd/info.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 4f092c4682..23c8beda65 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -85,11 +85,8 @@ module Homebrew def info info_args.parse if args.json - if args.json == "v1" || args.json == true - print_json - else - raise UsageError, "invalid JSON version: #{args.json}" - end + raise UsageError, "invalid JSON version: #{args.json}" unless ["v1", true].include? args.json + print_json elsif args.github? exec_browser(*ARGV.formulae.map { |f| github_info(f) }) else