-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #735 from forelabs/feat/decision-inheritance
Feature: Decision inheritance
- Loading branch information
Showing
5 changed files
with
139 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# frozen_string_literal: true | ||
|
||
module LicenseFinder | ||
module CLI | ||
class InheritedDecisions < Base | ||
extend Subcommand | ||
include MakesDecisions | ||
|
||
desc 'list', 'List all the inherited decision files' | ||
def list | ||
say 'Inherited Decision Files:', :blue | ||
say_each(decisions.inherited_decisions) | ||
end | ||
|
||
auditable | ||
desc 'add DECISION_FILE...', 'Add one or more decision files to the inherited decisions' | ||
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 | ||
|
||
auditable | ||
desc 'remove DECISION_FILE...', 'Remove one or more decision files from the inherited decisions' | ||
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 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters