Class: LicenseFinder::CLI::PermittedLicenses

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

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

#listObject



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

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

#remove(*licenses) ⇒ Object



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

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