Class: Ronin::UI::Output::Terminal::Color

Inherits:
Object
  • Object
show all
Defined in:
lib/ronin/ui/output/terminal/color.rb

Overview

The handler for color output to the terminal.

Constant Summary collapse

GREEN =

ANSI Green code

"\e[32m"
CYAN =

ANSI Cyan code

"\e[36m"
YELLOW =

ANSI Yellow code

"\e[33m"
RED =

ANSI Red code

"\e[31m"
CLEAR =

ANSI Clear code

"\e[0m"

Class Method Summary collapse

Class Method Details

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Prints a debug message.

Parameters:

  • message (String)

    The message to print.

Since:

  • 1.0.0



82
83
84
# File 'lib/ronin/ui/output/terminal/color.rb', line 82

def self.print_debug(message)
  puts "#{CYAN}[=] #{message}#{CLEAR}"
end

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Prints an error message.

Parameters:

  • message (String)

    The message to print.

Since:

  • 1.0.0



110
111
112
# File 'lib/ronin/ui/output/terminal/color.rb', line 110

def self.print_error(message)
  puts "#{RED}[!] #{message}#{CLEAR}"
end

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Prints an info message.

Parameters:

  • message (String)

    The message to print.

Since:

  • 1.0.0



68
69
70
# File 'lib/ronin/ui/output/terminal/color.rb', line 68

def self.print_info(message)
  puts "#{GREEN}[-] #{message}#{CLEAR}"
end

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Prints a warning message.

Parameters:

  • message (String)

    The message to print.

Since:

  • 1.0.0



96
97
98
# File 'lib/ronin/ui/output/terminal/color.rb', line 96

def self.print_warning(message)
  puts "#{YELLOW}[*] #{message}#{CLEAR}"
end

.write(data) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Writes data to STDOUT.

Parameters:

  • data (String)

    The data to write.

Since:

  • 1.0.0



54
55
56
# File 'lib/ronin/ui/output/terminal/color.rb', line 54

def self.write(data)
  STDOUT.write(data)
end