Module: GithubActions::Colorizer

Included in:
ContainerRunner, Container, JobRunner, Tasks::Details, Tasks::Run, Tasks::RunAll
Defined in:
lib/tasks/github_actions/github_actions/colorizer.rb

Overview

helper methods for colorizing output, if the “rainbow” colorizing gem is not installed then it prints the original messages without any colorizing

Instance Method Summary collapse

Instance Method Details

#error(msg) ⇒ Object

print an error

Parameters:

  • msg (Object)

    the text to print



27
28
29
# File 'lib/tasks/github_actions/github_actions/colorizer.rb', line 27

def error(msg)
  print_colored(msg, :red)
end

#info(msg) ⇒ Object

print a message

Parameters:

  • msg (Object)

    the text to print



45
46
47
# File 'lib/tasks/github_actions/github_actions/colorizer.rb', line 45

def info(msg)
  print_colored(msg, :cyan)
end

#stage(msg) ⇒ Object

print the progress status

Parameters:

  • msg (Object)

    the text to print



51
52
53
# File 'lib/tasks/github_actions/github_actions/colorizer.rb', line 51

def stage(msg)
  print_colored(msg, :yellow)
end

#success(msg) ⇒ Object

print a success message

Parameters:

  • msg (Object)

    the text to print



33
34
35
# File 'lib/tasks/github_actions/github_actions/colorizer.rb', line 33

def success(msg)
  print_colored(msg, :green)
end

#warning(msg) ⇒ Object

print a warning

Parameters:

  • msg (Object)

    the text to print



39
40
41
# File 'lib/tasks/github_actions/github_actions/colorizer.rb', line 39

def warning(msg)
  print_colored(msg, :magenta)
end