Class: DependencyBot::Checkers

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeCheckers

Returns a new instance of Checkers.



15
16
17
# File 'lib/dependency_bot/checkers.rb', line 15

def initialize
  @checkers = []
end

Instance Attribute Details

#checkersObject (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

#runObject



23
24
25
# File 'lib/dependency_bot/checkers.rb', line 23

def run
  @checkers.map(&:verify).flatten
end