Class: LicenseFinder::CLI::Blacklist

Inherits:
Base
  • Object
show all
Extended by:
Subcommand
Includes:
MakesDecisions
Defined in:
lib/license_finder/cli/blacklist.rb

Instance Method Summary collapse

Methods included from Subcommand

banner

Methods included from MakesDecisions

included

Instance Method Details

#add(*licenses) ⇒ Object



17
18
19
20
21
# File 'lib/license_finder/cli/blacklist.rb', line 17

def add(*licenses)
  assert_some licenses
  modifying { licenses.each { |l| decisions.blacklist(l, txn) } }
  say "Added #{licenses.join(', ')} to the license blacklist"
end

#listObject



10
11
12
13
# File 'lib/license_finder/cli/blacklist.rb', line 10

def list
  say 'Blacklisted Licenses:', :blue
  say_each(decisions.blacklisted, &:name)
end

#remove(*licenses) ⇒ Object



25
26
27
28
29
# File 'lib/license_finder/cli/blacklist.rb', line 25

def remove(*licenses)
  assert_some licenses
  modifying { licenses.each { |l| decisions.unblacklist(l, txn) } }
  say "Removed #{licenses.join(', ')} from the license blacklist"
end