Class: BruteCLI::ToolOutput::Base

Inherits:
Object
  • Object
show all
Includes:
BruteCLI
Defined in:
lib/brute_cli/tool_output.rb

Constant Summary collapse

ICON =
Emoji::GEAR

Constants included from BruteCLI

ACCENT, ACCENT_BG, ACCENT_BG2, ACCENT_BOLD, COLOR, DEFAULT_THEME, DIM, ERROR_BG, ERROR_FG, MONIKER, BruteCLI::THEMES

Instance Method Summary collapse

Methods included from BruteCLI

apply_theme!, config, error, warn

Constructor Details

#initialize(name:, args: {}, width: 80) ⇒ Base

Returns a new instance of Base.



10
11
12
13
14
# File 'lib/brute_cli/tool_output.rb', line 10

def initialize(name:, args: {}, width: 80)
  @name  = name.to_s
  @args  = args.is_a?(Hash) ? args : {}
  @width = width
end

Instance Method Details

#headerObject

Icon + colorized name + summary (file path, command, etc.)



17
18
19
# File 'lib/brute_cli/tool_output.rb', line 17

def header
  "#{icon} #{@name.colorize(ACCENT_BG)} #{summary}".rstrip
end