summaryrefslogtreecommitdiff
path: root/lib/system_check/simple_executor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system_check/simple_executor.rb')
-rw-r--r--lib/system_check/simple_executor.rb30
1 files changed, 21 insertions, 9 deletions
diff --git a/lib/system_check/simple_executor.rb b/lib/system_check/simple_executor.rb
index 2ffe837e326..fc07f09dcb2 100644
--- a/lib/system_check/simple_executor.rb
+++ b/lib/system_check/simple_executor.rb
@@ -1,16 +1,22 @@
module SystemCheck
+ # Simple Executor is current default executor for GitLab
+ # It is a simple port from display logic in the old check.rake
+ #
+ # There is no concurrency level and the output is progressively
+ # printed into the STDOUT
class SimpleExecutor < BaseExecutor
+ # Executes defined checks in the specified order and outputs confirmation or error information
def execute
start_checking(component)
@checks.each do |check|
- print "#{check.name}"
+ $stdout.print "#{check.name}"
if check.skip?
- puts "skipped #{'('+skip_message+')' if skip_message}".color(:magenta)
+ $stdout.puts "skipped #{'(' + skip_message + ')' if skip_message}".color(:magenta)
elsif check.check?
- puts 'yes'.color(:green)
+ $stdout.puts 'yes'.color(:green)
else
- puts 'no'.color(:red)
+ $stdout.puts 'no'.color(:red)
check.show_error
end
end
@@ -20,15 +26,21 @@ module SystemCheck
private
+ # Prints header content for the series of checks to be executed for this component
+ #
+ # @param [String] component name of the component relative to the checks being executed
def start_checking(component)
- puts "Checking #{component.color(:yellow)} ..."
- puts ''
+ $stdout.puts "Checking #{component.color(:yellow)} ..."
+ $stdout.puts ''
end
+ # Prints footer content for the series of checks executed for this component
+ #
+ # @param [String] component name of the component relative to the checks being executed
def finished_checking(component)
- puts ''
- puts "Checking #{component.color(:yellow)} ... #{"Finished".color(:green)}"
- puts ''
+ $stdout.puts ''
+ $stdout.puts "Checking #{component.color(:yellow)} ... #{'Finished'.color(:green)}"
+ $stdout.puts ''
end
end
end