Class: LicenseFinder::CLI::RestrictedLicenses

Inherits:
Base
  • Object
show all
Extended by:
Subcommand
Includes:
MakesDecisions
Defined in:
lib/license_finder/cli/restricted_licenses.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/restricted_licenses.rb', line 17

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

#listObject



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

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

#remove(*licenses) ⇒ Object



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

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