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

multi_check_helpers.rb « system_check « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1b06864a63e5ed2c765c2e298985c8be2655aa2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

module SystemCheck
  # Helpers used inside a SystemCheck instance to standardize output responses
  # when using a multi_check version
  module MultiCheckHelpers
    def print_skipped(reason)
      $stdout.puts 'skipped'.color(:magenta)

      $stdout.puts '  Reason:'.color(:blue)
      $stdout.puts "  #{reason}"
    end

    def print_warning(reason)
      $stdout.puts 'warning'.color(:magenta)

      $stdout.puts '  Reason:'.color(:blue)
      $stdout.puts "  #{reason}"
    end

    def print_failure(reason)
      $stdout.puts 'no'.color(:red)

      $stdout.puts '  Reason:'.color(:blue)
      $stdout.puts "  #{reason}"
    end

    def print_pass
      $stdout.puts self.class.check_pass.color(:green)
    end
  end
end