Class: FaHarnessTools::CheckLogger
- Inherits:
-
Object
- Object
- FaHarnessTools::CheckLogger
- Defined in:
- lib/fa-harness-tools/check_logger.rb
Instance Method Summary collapse
- #context_info(client, context) ⇒ Object
- #fail(message) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(name:, description:) ⇒ CheckLogger
constructor
A new instance of CheckLogger.
- #pass(message) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(name:, description:) ⇒ CheckLogger
Returns a new instance of CheckLogger.
5 6 7 8 9 |
# File 'lib/fa-harness-tools/check_logger.rb', line 5 def initialize(name:, description:) @name = name @description = description @pastel = Pastel.new(enabled: true) end |
Instance Method Details
#context_info(client, context) ⇒ Object
19 20 21 22 |
# File 'lib/fa-harness-tools/check_logger.rb', line 19 def context_info(client, context) info("we're deploying repo #{client.owner_repo} into environment #{context.environment}") info("we're trying to deploy commit #{context.new_commit_sha}") end |
#fail(message) ⇒ Object
29 30 31 32 |
# File 'lib/fa-harness-tools/check_logger.rb', line 29 def fail() puts @pastel.red("FAIL: #{}") false end |
#info(message) ⇒ Object
15 16 17 |
# File 'lib/fa-harness-tools/check_logger.rb', line 15 def info() puts " ... #{}" end |
#pass(message) ⇒ Object
24 25 26 27 |
# File 'lib/fa-harness-tools/check_logger.rb', line 24 def pass() puts @pastel.green("PASS: #{}") true end |
#start ⇒ Object
11 12 13 |
# File 'lib/fa-harness-tools/check_logger.rb', line 11 def start puts @pastel.cyan(@pastel.bold(@name), %{ (#{@description})}) end |