2017-02-13 03:45:39 -05:00
|
|
|
# Library to perform System Checks
|
|
|
|
#
|
|
|
|
# Every Check is implemented as its own class inherited from SystemCheck::BaseCheck
|
|
|
|
# Execution coordination and boilerplate output is done by the SystemCheck::SimpleExecutor
|
|
|
|
#
|
|
|
|
# This structure decouples checks from Rake tasks and facilitates unit-testing
|
2017-02-12 18:33:31 -05:00
|
|
|
module SystemCheck
|
2017-02-13 03:45:39 -05:00
|
|
|
# Executes a bunch of checks for specified component
|
|
|
|
#
|
|
|
|
# @param [String] component name of the component relative to the checks being executed
|
|
|
|
# @param [Array<BaseCheck>] checks classes of corresponding checks to be executed in the same order
|
2017-05-30 13:06:58 -04:00
|
|
|
def self.run(component, checks = [])
|
|
|
|
executor = SimpleExecutor.new(component)
|
2017-02-13 06:21:12 -05:00
|
|
|
|
2017-02-13 03:45:39 -05:00
|
|
|
checks.each do |check|
|
|
|
|
executor << check
|
2017-02-12 18:33:31 -05:00
|
|
|
end
|
2017-02-13 06:21:12 -05:00
|
|
|
|
2017-05-30 13:06:58 -04:00
|
|
|
executor.execute
|
2017-02-12 18:33:31 -05:00
|
|
|
end
|
|
|
|
end
|