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, #initialize, #output, #render, #template_vars, #user_interaction?, #view_path, #views_directories

Constructor Details

This class inherits a constructor from CMSScanner::Formatter::Base

Instance Method Details

#amber(text) ⇒ Object



17
18
19
# File 'app/formatters/cli.rb', line 17

def amber(text)
  colorize(text, 33)
end

#blue(text) ⇒ Object



21
22
23
# File 'app/formatters/cli.rb', line 21

def blue(text)
  colorize(text, 34)
end

#bold(text) ⇒ Object



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

def bold(text)
  colorize(text, 1)
end

#colorize(text, color_code) ⇒ Object



25
26
27
# File 'app/formatters/cli.rb', line 25

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

#green(text) ⇒ Object



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

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

#red(text) ⇒ Object



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

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