class Dracula::UI

Public Class Methods

bold(str) click to toggle source
# File lib/dracula/ui.rb, line 4
def self.bold(str)
  if $stdout.tty? # colorize only if output is terminal
    "\e[34m#{str}\e[0m"
  else
    str
  end
end
danger(str) click to toggle source
# File lib/dracula/ui.rb, line 12
def self.danger(str)
  if $stdout.tty? # colorize only if output is terminal
    "\e[31m#{str}\e[0m"
  else
    str
  end
end
error(str) click to toggle source
# File lib/dracula/ui.rb, line 20
def self.error(str)
  danger("[ERROR] ") + str.to_s
end
print_table(array, options = {}) click to toggle source

Prints a table. Shamelesly copied from thor.

Parameters

Array[Array[String, String, …]]

Options

indent<Integer>

Indent the first column by indent value.

colwidth<Integer>

Force the first column to colwidth spaces wide.