summaryrefslogtreecommitdiff
path: root/lib/system_check.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system_check.rb')
-rw-r--r--lib/system_check.rb12
1 files changed, 12 insertions, 0 deletions
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