File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,16 +13,8 @@ require 'fuzzy_match'
1313# Display usage instructions
1414puts File . read ( __FILE__ ) . scan ( /^# .*/ ) [ 0 ...3 ] . join ( "\n " ) . gsub ( /^# / , '' ) if ARGV . count != 1
1515
16- class TrueClass
17- def to_s
18- 'Yes' . green
19- end
20- end
21-
22- class FalseClass
23- def to_s
24- 'No' . red
25- end
16+ def yes_no ( value )
17+ value ? 'Yes' . green : 'No' . red
2618end
2719
2820license = ARGV [ 0 ] . downcase . strip
@@ -47,16 +39,16 @@ rows << ['SPDX ID', id]
4739rows << [ 'SPDX Name' , name ]
4840
4941approvals . each do |approver , licenses |
50- rows << [ "#{ approver } approved" , licenses . include? ( license ) ]
42+ rows << [ "#{ approver } approved" , yes_no ( licenses . include? ( license ) ) ]
5143end
5244
5345license_ids = licenses . map { |l | l [ 'id' ] }
5446current = license_ids . include? ( license )
55- rows << [ 'Current license' , current ]
47+ rows << [ 'Current license' , yes_no ( current ) ]
5648
5749rows << :separator
5850eligible = !current && spdx && approved_licenses . include? ( license )
59- rows << [ 'Eligible' , eligible ]
51+ rows << [ 'Eligible' , yes_no ( eligible ) ]
6052
6153puts Terminal ::Table . new title : "License: #{ license } " , rows :
6254puts
You can’t perform that action at this time.
0 commit comments