Module: Ronin::Support::CLI::Printing
- Included in:
- Mixin
- Defined in:
- lib/ronin/support/cli/printing.rb
Overview
Printing methods.
Instance Attribute Summary collapse
-
#debug ⇒ Object
writeonly
Enables or disables debug mode.
Class Method Summary collapse
-
.debug=(debug_mode) ⇒ Boolean
Sets the debug mode.
-
.debug? ⇒ Boolean
The current debug mode.
Instance Method Summary collapse
-
#debug? ⇒ Boolean
Determines if debug mode has been enabled.
-
#print_debug(message) ⇒ Boolean
Prints a debug message.
-
#print_error(message) ⇒ Boolean
Prints an error message.
-
#print_info(message) ⇒ Boolean
(also: #print_status)
Prints an info message.
-
#print_negative(message) ⇒ Boolean
(also: #print_failure, #print_bad)
Prints a negative message.
-
#print_positive(message) ⇒ Boolean
(also: #print_success, #print_good)
Prints a positive message.
-
#print_warning(message) ⇒ Boolean
Prints a warning message.
Instance Attribute Details
#debug=(value) ⇒ Object (writeonly)
Enables or disables debug mode.
62 63 64 |
# File 'lib/ronin/support/cli/printing.rb', line 62 def debug=(value) @debug = value end |
Class Method Details
.debug=(debug_mode) ⇒ Boolean
Sets the debug mode.
55 56 57 |
# File 'lib/ronin/support/cli/printing.rb', line 55 def self.debug=(debug_mode) @debug = debug_mode end |
.debug? ⇒ Boolean
The current debug mode.
40 41 42 |
# File 'lib/ronin/support/cli/printing.rb', line 40 def self.debug? @debug end |
Instance Method Details
#debug? ⇒ Boolean
Determines if debug mode has been enabled.
71 72 73 |
# File 'lib/ronin/support/cli/printing.rb', line 71 def debug? @debug || Printing.debug? end |
#print_debug(message) ⇒ Boolean
Note:
Will return false
unless verbose printing is enabled.
Prints a debug message.
115 116 117 118 119 120 121 122 |
# File 'lib/ronin/support/cli/printing.rb', line 115 def print_debug() if debug? $stdout.puts "#{ANSI.bold(ANSI.yellow('[?]'))} #{}#{ANSI.reset}" return true else return false end end |
#print_error(message) ⇒ Boolean
Prints an error message.
159 160 161 162 |
# File 'lib/ronin/support/cli/printing.rb', line 159 def print_error() $stdout.puts "#{ANSI.bold(ANSI.red('[!]'))} #{}#{ANSI.reset}" return true end |
#print_info(message) ⇒ Boolean Also known as: print_status
Prints an info message.
90 91 92 93 |
# File 'lib/ronin/support/cli/printing.rb', line 90 def print_info() $stdout.puts "#{ANSI.bold(ANSI.white('[*]'))} #{}#{ANSI.reset}" return true end |
#print_negative(message) ⇒ Boolean Also known as: print_failure, print_bad
Prints a negative message.
206 207 208 209 |
# File 'lib/ronin/support/cli/printing.rb', line 206 def print_negative() $stdout.puts "#{ANSI.bold(ANSI.red('[-]'))} #{}#{ANSI.reset}" return true end |