Class: WPScan::Formatter::Cli
- Inherits:
-
Base
- Object
- Base
- WPScan::Formatter::Cli
show all
- Defined in:
- app/formatters/cli.rb
Overview
Constant Summary
Constants inherited
from Base
Base::ERB_SUPPORTS_KVARGS
Instance Attribute Summary
Attributes inherited from Base
#controller_name
Instance Method Summary
collapse
Methods inherited from Base
#base_format, #beautify, #format, #formats, #initialize, #output, #render, #template_vars, #user_interaction?, #view_path, #views_directories
Instance Method Details
#amber(text) ⇒ String
61
62
63
|
# File 'app/formatters/cli.rb', line 61
def amber(text)
colorize(text, 33)
end
|
#bar_clear ⇒ Object
ANSI sequence to clear the current line and return to column 0. Emitted at the start of each streamed enumeration finding so the ruby-progressbar line (which redraws via r and leaves its previous render visible when interleaved with foreign output) gets wiped before the finding prints. No-op on non-TTY stdout so file/pipe output stays clean.
17
18
19
|
# File 'app/formatters/cli.rb', line 17
def bar_clear
$stdout.tty? ? "\e[2K\r" : ''
end
|
#blue(text) ⇒ String
67
68
69
|
# File 'app/formatters/cli.rb', line 67
def blue(text)
colorize(text, 34)
end
|
#bold(text) ⇒ String
43
44
45
|
# File 'app/formatters/cli.rb', line 43
def bold(text)
colorize(text, 1)
end
|
#colorize(text, color_code) ⇒ String
74
75
76
|
# File 'app/formatters/cli.rb', line 74
def colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"
end
|
#critical_icon ⇒ String
37
38
39
|
# File 'app/formatters/cli.rb', line 37
def critical_icon
red('[!]')
end
|
#green(text) ⇒ String
55
56
57
|
# File 'app/formatters/cli.rb', line 55
def green(text)
colorize(text, 32)
end
|
#info_icon ⇒ String
22
23
24
|
# File 'app/formatters/cli.rb', line 22
def info_icon
green('[+]')
end
|
#notice_icon ⇒ String
27
28
29
|
# File 'app/formatters/cli.rb', line 27
def notice_icon
blue('[i]')
end
|
#red(text) ⇒ String
49
50
51
|
# File 'app/formatters/cli.rb', line 49
def red(text)
colorize(text, 31)
end
|
#streams? ⇒ Boolean
7
8
9
|
# File 'app/formatters/cli.rb', line 7
def streams?
true
end
|
#warning_icon ⇒ String
32
33
34
|
# File 'app/formatters/cli.rb', line 32
def warning_icon
amber('[!]')
end
|