Class: LicenseFinder::CLI::InheritedDecisions

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

Instance Method Summary collapse

Methods included from Subcommand

banner

Methods included from MakesDecisions

included

Instance Method Details

#add(*decision_files) ⇒ Object



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

def add(*decision_files)
  assert_some decision_files
  modifying { decision_files.each { |filepath| decisions.inherit_from(filepath) } }
  say "Added #{decision_files.join(', ')} to the inherited decisions"
end

#listObject



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

def list
  say 'Inherited Decision Files:', :blue
  say_each(decisions.inherited_decisions)
end

#remove(*decision_files) ⇒ Object



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

def remove(*decision_files)
  assert_some decision_files
  modifying { decision_files.each { |filepath| decisions.remove_inheritance(filepath) } }
  say "Removed #{decision_files.join(', ')} from the inherited decisions"
end