summaryrefslogtreecommitdiff
path: root/lib/system_check.rb
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2017-05-30 19:06:58 +0200
committerGabriel Mazetto <brodock@gmail.com>2017-05-31 14:33:03 +0200
commit3f187751d40a687ab9b76857c04849bab0f84357 (patch)
tree2165e91838e774e5c80dbd37eba88551526fe1e7 /lib/system_check.rb
parentbca5603740f77667dda6355c457ad1791b4fa42e (diff)
downloadgitlab-ce-3f187751d40a687ab9b76857c04849bab0f84357.tar.gz
Fixed and improved some existing checks and SystemCheck library
Diffstat (limited to 'lib/system_check.rb')
-rw-r--r--lib/system_check.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/system_check.rb b/lib/system_check.rb
index e9cbf6b8258..466c39904fa 100644
--- a/lib/system_check.rb
+++ b/lib/system_check.rb
@@ -9,22 +9,13 @@ module SystemCheck
#
# @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
- # @param [BaseExecutor] executor_klass optionally specifiy a different executor class
- def self.run(component, checks = [], executor_klass = SimpleExecutor)
- unless executor_klass < BaseExecutor
- raise ArgumentError, 'Invalid executor'
- end
-
- prepare(component, checks, executor_klass).execute
- end
+ def self.run(component, checks = [])
+ executor = SimpleExecutor.new(component)
- def self.prepare(component, checks = [], executor_klass = SimpleExecutor)
- executor = executor_klass.new(component)
checks.each do |check|
executor << check
end
- executor
+ executor.execute
end
- private_class_method :prepare
end