Class: Ronin::UI::Output::Terminal::Color
- 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"
- BRIGHT =
ANSI Bright code
"\e[1m"
- BRIGHT_OFF =
ANSI Bright-Off code
"\e[21m"
- CLEAR =
ANSI Clear code
"\e[0m"
Class Method Summary collapse
-
.print_debug(message) ⇒ Object
private
Prints a
debug
message. -
.print_error(message) ⇒ Object
private
Prints an
error
message. -
.print_info(message) ⇒ Object
private
Prints an
info
message. -
.print_warning(message) ⇒ Object
private
Prints a
warning
message. -
.write(data) ⇒ Object
private
Writes data to
STDOUT
.
Class Method Details
.print_debug(message) ⇒ 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.
Prints a debug
message.
88 89 90 |
# File 'lib/ronin/ui/output/terminal/color.rb', line 88 def self.print_debug() $stdout.puts "#{CYAN}#{BRIGHT}[=]#{BRIGHT_OFF} #{}#{CLEAR}" end |
.print_error(message) ⇒ 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.
Prints an error
message.
116 117 118 |
# File 'lib/ronin/ui/output/terminal/color.rb', line 116 def self.print_error() $stdout.puts "#{RED}#{BRIGHT}[!]#{BRIGHT_OFF} #{}#{CLEAR}" end |
.print_info(message) ⇒ 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.
Prints an info
message.
74 75 76 |
# File 'lib/ronin/ui/output/terminal/color.rb', line 74 def self.print_info() $stdout.puts "#{GREEN}#{BRIGHT}[-]#{BRIGHT_OFF} #{}#{CLEAR}" end |
.print_warning(message) ⇒ 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.
Prints a warning
message.
102 103 104 |
# File 'lib/ronin/ui/output/terminal/color.rb', line 102 def self.print_warning() $stdout.puts "#{YELLOW}#{BRIGHT}[*]#{BRIGHT_OFF} #{}#{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
.
60 61 62 |
# File 'lib/ronin/ui/output/terminal/color.rb', line 60 def self.write(data) $stdout.write(data) end |