Class: LicenseFinder::CLI::RestrictedLicenses
- Extended by:
- Subcommand
- Includes:
- MakesDecisions
- Defined in:
- lib/license_finder/cli/restricted_licenses.rb
Instance Method Summary collapse
Methods included from Subcommand
Methods included from MakesDecisions
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 { licenses.each { |l| decisions.restrict(l, txn) } } printer.say "Added #{licenses.join(', ')} to the restricted licenses" end |
#list ⇒ Object
10 11 12 13 |
# File 'lib/license_finder/cli/restricted_licenses.rb', line 10 def list printer.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 { licenses.each { |l| decisions.unrestrict(l, txn) } } printer.say "Removed #{licenses.join(', ')} from the restricted licenses" end |