Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system_check/simple_executor.rb')
-rw-r--r--lib/system_check/simple_executor.rb24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/system_check/simple_executor.rb b/lib/system_check/simple_executor.rb
index c5403693f7a..dc2d4643a01 100644
--- a/lib/system_check/simple_executor.rb
+++ b/lib/system_check/simple_executor.rb
@@ -4,7 +4,29 @@ module SystemCheck
#
# There is no concurrency level and the output is progressively
# printed into the STDOUT
- class SimpleExecutor < BaseExecutor
+ #
+ # @attr_reader [Array<BaseCheck>] checks classes of corresponding checks to be executed in the same order
+ # @attr_reader [String] component name of the component relative to the checks being executed
+ class SimpleExecutor
+ attr_reader :checks
+ attr_reader :component
+
+ # @param [String] component name of the component relative to the checks being executed
+ def initialize(component)
+ raise ArgumentError unless component.is_a? String
+
+ @component = component
+ @checks = Set.new
+ end
+
+ # Add a check to be executed
+ #
+ # @param [BaseCheck] check class
+ def <<(check)
+ raise ArgumentError unless check < BaseCheck
+ @checks << check
+ end
+
# Executes defined checks in the specified order and outputs confirmation or error information
def execute
start_checking(component)