From 88eae0633b1bdbdead23bbf638267f53c6c0be9c Mon Sep 17 00:00:00 2001 From: lionellloh Date: Thu, 9 Jul 2020 13:01:10 +0800 Subject: [PATCH] overwrote license attr_rw with a special license method --- Library/Homebrew/formula.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index c1e1fc8f0d..6cf72c71a8 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1682,7 +1682,7 @@ class Formula "aliases" => aliases.sort, "versioned_formulae" => versioned_formulae.map(&:name), "desc" => desc, - "license" => license, + "license" => license.class == String ? [license] : license, "homepage" => homepage, "versions" => { "stable" => stable&.version&.to_s, @@ -2210,7 +2210,17 @@ class Formula # Shows when running `brew info`. # #
license "BSD-2-Clause"
- attr_rw :license + def license args=nil + if args.blank? + return @licenses + else + @licenses = args.class == String ? [args] : args + puts @licenses + # license. + end + end + + # attr_rw :license # @!attribute [w] homepage # The homepage for the software. Used by users to get more information