Class: LicenseFinder::CLI::InheritedDecisions
- Extended by:
- Subcommand
- Includes:
- MakesDecisions
- Defined in:
- lib/license_finder/cli/inherited_decisions.rb
Instance Method Summary collapse
- #add(*decision_files) ⇒ Object
- #add_with_auth(*params) ⇒ Object
- #list ⇒ Object
- #remove(*decision_files) ⇒ Object
- #remove_with_auth(*params) ⇒ Object
Methods included from Subcommand
Methods included from MakesDecisions
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 { decision_files.each { |filepath| decisions.inherit_from(filepath) } } printer.say "Added #{decision_files.join(', ')} to the inherited decisions" end |
#add_with_auth(*params) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/license_finder/cli/inherited_decisions.rb', line 25 def add_with_auth(*params) url, auth_type, token_or_env = params auth_info = { 'url' => url, 'authorization' => "#{auth_type} #{token_or_env}" } { decisions.add_decision [:inherit_from, auth_info] } printer.say "Added #{url} to the inherited decisions" end |
#list ⇒ Object
10 11 12 13 |
# File 'lib/license_finder/cli/inherited_decisions.rb', line 10 def list printer.say 'Inherited Decision Files:', :blue say_each(decisions.inherited_decisions) end |
#remove(*decision_files) ⇒ Object
34 35 36 37 38 |
# File 'lib/license_finder/cli/inherited_decisions.rb', line 34 def remove(*decision_files) assert_some decision_files { decision_files.each { |filepath| decisions.remove_inheritance(filepath) } } printer.say "Removed #{decision_files.join(', ')} from the inherited decisions" end |
#remove_with_auth(*params) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/license_finder/cli/inherited_decisions.rb', line 42 def remove_with_auth(*params) url, auth_type, token_or_env = params auth_info = { 'url' => url, 'authorization' => "#{auth_type} #{token_or_env}" } { decisions.remove_inheritance(auth_info) } printer.say "Removed #{url} from the inherited decisions" end |