Class: CMSScanner::Formatter::Cli

Inherits:
Base
  • Object
show all
Defined in:
app/formatters/cli.rb

Overview

CLI Formatter

Direct Known Subclasses

CliNoColour

Instance Attribute Summary

Attributes inherited from Base

#controller_name

Instance Method Summary collapse

Methods inherited from Base

#base_format, #beautify, #format, #formats, #output, #render, #template_vars, #view_path, #views_directories

Instance Method Details

#colorize(text, color_code) ⇒ Object



13
14
15
# File 'app/formatters/cli.rb', line 13

def colorize(text, color_code)
  "\e[#{color_code}m#{text}\e[0m"
end

#green(text) ⇒ Object



9
10
11
# File 'app/formatters/cli.rb', line 9

def green(text)
  colorize(text, 32)
end

#red(text) ⇒ Object



5
6
7
# File 'app/formatters/cli.rb', line 5

def red(text)
  colorize(text, 31)
end