Skip to content

Commit 9f60a8c

Browse files
authored
rubocop
1 parent 39be3f4 commit 9f60a8c

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

script/check-approval

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,8 @@ require 'fuzzy_match'
1313
# Display usage instructions
1414
puts 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
2618
end
2719

2820
license = ARGV[0].downcase.strip
@@ -47,16 +39,16 @@ rows << ['SPDX ID', id]
4739
rows << ['SPDX Name', name]
4840

4941
approvals.each do |approver, licenses|
50-
rows << ["#{approver} approved", licenses.include?(license)]
42+
rows << ["#{approver} approved", yes_no(licenses.include?(license))]
5143
end
5244

5345
license_ids = licenses.map { |l| l['id'] }
5446
current = license_ids.include?(license)
55-
rows << ['Current license', current]
47+
rows << ['Current license', yes_no(current)]
5648

5749
rows << :separator
5850
eligible = !current && spdx && approved_licenses.include?(license)
59-
rows << ['Eligible', eligible]
51+
rows << ['Eligible', yes_no(eligible)]
6052

6153
puts Terminal::Table.new title: "License: #{license}", rows:
6254
puts

0 commit comments

Comments
 (0)