Class: DependencyBot::Checkers
- Inherits:
-
Object
- Object
- DependencyBot::Checkers
- Defined in:
- lib/dependency_bot/checkers.rb
Overview
This class is responsible for managing a collection of checkers that verify various aspects of the DependencyBot’s configuration and functionality. It allows adding new checkers and running all of them to get a list of issues found. # Each checker should implement a ‘verify` method that returns an array of issues found. # Example usage:
checkers = DependencyBot::Checkers.new
checkers.add_checker(SomeChecker.new)
issues = checkers.run
Instance Attribute Summary collapse
-
#checkers ⇒ Object
readonly
Returns the value of attribute checkers.
Instance Method Summary collapse
- #add_checker(checker) ⇒ Object
-
#initialize ⇒ Checkers
constructor
A new instance of Checkers.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Checkers
Returns a new instance of Checkers.
15 16 17 |
# File 'lib/dependency_bot/checkers.rb', line 15 def initialize @checkers = [] end |
Instance Attribute Details
#checkers ⇒ Object (readonly)
Returns the value of attribute checkers.
13 14 15 |
# File 'lib/dependency_bot/checkers.rb', line 13 def checkers @checkers end |
Instance Method Details
#add_checker(checker) ⇒ Object
19 20 21 |
# File 'lib/dependency_bot/checkers.rb', line 19 def add_checker(checker) @checkers << checker end |
#run ⇒ Object
23 24 25 |
# File 'lib/dependency_bot/checkers.rb', line 23 def run @checkers.map(&:verify).flatten end |