diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index 17232e8dd4a24..9427fc0c5f424 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -62,13 +62,12 @@ def run end json = { - "formulae" => json_info(formulae), - "casks" => json_info(casks), + formulae: json_info(formulae), + casks: json_info(casks), } puts JSON.pretty_generate(json) outdated = formulae + casks - else outdated = if args.formula? outdated_formulae @@ -170,10 +169,7 @@ def json_version(version) "v1" => :v1, "v2" => :v2, } - - raise UsageError, "invalid JSON version: #{version}" unless version_hash.include?(version) - - version_hash[version] + version_hash.fetch(version) { raise UsageError, "invalid JSON version: #{version}" } end sig { returns(T::Array[Formula]) } diff --git a/Library/Homebrew/test/support/helper/cmd/brew-verify-undefined.rb b/Library/Homebrew/test/support/helper/cmd/brew-verify-undefined.rb old mode 100755 new mode 100644