From 500e5227a08bd603a2943c3c7d2efcaf4a40cc15 Mon Sep 17 00:00:00 2001 From: Gabriel Mazetto Date: Mon, 13 Feb 2017 00:33:31 +0100 Subject: WIP SystemCheck library for executing checks from a rake task --- lib/system_check.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/system_check.rb (limited to 'lib/system_check.rb') diff --git a/lib/system_check.rb b/lib/system_check.rb new file mode 100644 index 00000000000..1d09b57911a --- /dev/null +++ b/lib/system_check.rb @@ -0,0 +1,12 @@ +module SystemCheck + def self.run(component, checks = {}, executor_klass = SimpleExecutor) + unless executor_klass.is_a? BaseExecutor + raise ArgumentError, 'Invalid executor' + end + + executor = executor_klass.new(component) + executor.checks = checks.map do |check| + raise ArgumentError unless check.is_a? BaseCheck + end + end +end -- cgit v1.2.1