diff options
author | Gabriel Mazetto <brodock@gmail.com> | 2017-02-13 00:33:31 +0100 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2017-05-31 14:33:03 +0200 |
commit | 500e5227a08bd603a2943c3c7d2efcaf4a40cc15 (patch) | |
tree | bb0561e03b6bff783a925c479412dfa043376190 /lib/system_check.rb | |
parent | 19ee16a0f85dd4bacddbd066237e62a1bbb7113a (diff) | |
download | gitlab-ce-500e5227a08bd603a2943c3c7d2efcaf4a40cc15.tar.gz |
WIP SystemCheck library for executing checks from a rake task
Diffstat (limited to 'lib/system_check.rb')
-rw-r--r-- | lib/system_check.rb | 12 |
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 |