Class: Codeowners::Cli::InteractiveRunner
- Inherits:
-
Object
- Object
- Codeowners::Cli::InteractiveRunner
- Includes:
- InteractiveOps
- Defined in:
- lib/codeowners/cli/interactive_runner.rb
Overview
Interactive session to resolve codeowners list issues
Instance Attribute Summary collapse
-
#autocommit ⇒ Object
writeonly
Sets the attribute autocommit.
-
#default_owner ⇒ Object
writeonly
Sets the attribute default_owner.
-
#validate_owners ⇒ Object
writeonly
Sets the attribute validate_owners.
Instance Method Summary collapse
Methods included from InteractiveOps
Instance Attribute Details
#autocommit=(value) ⇒ Object (writeonly)
Sets the attribute autocommit
12 13 14 |
# File 'lib/codeowners/cli/interactive_runner.rb', line 12 def autocommit=(value) @autocommit = value end |
#default_owner=(value) ⇒ Object (writeonly)
Sets the attribute default_owner
12 13 14 |
# File 'lib/codeowners/cli/interactive_runner.rb', line 12 def default_owner=(value) @default_owner = value end |
#validate_owners=(value) ⇒ Object (writeonly)
Sets the attribute validate_owners
12 13 14 |
# File 'lib/codeowners/cli/interactive_runner.rb', line 12 def validate_owners=(value) @validate_owners = value end |
Instance Method Details
#run_with(checker) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/codeowners/cli/interactive_runner.rb', line 14 def run_with(checker) resolver = InteractiveResolver.new(checker, @validate_owners, @default_owner) checker.fix!.each do |(error_type, inconsistencies, )| resolver.handle(error_type, inconsistencies, ) end resolver.print_epilogue return unless resolver.made_changes? write_changes(checker) checker.commit_changes! if @autocommit || yes?('Commit changes?') end |