class AcquiaToolbelt::CLI::UI

Public Instance Methods

debug(text) click to toggle source

Internal: Used for outputting a pretty debug message.

text - The text to run through and output to the end user.

Returns the string coloured and formatted.

# File lib/acquia_toolbelt/cli/ui.rb, line 39
def debug(text)
  puts "#{text}".foreground(:yellow)
end
fail(text) click to toggle source

Internal: Used for outputting a pretty error message.

text - The text to run through and output to the end user.

Returns the string coloured and formatted.

# File lib/acquia_toolbelt/cli/ui.rb, line 21
def fail(text)
  puts "#{text}".foreground(:red)
end
info(text) click to toggle source

Internal: Used for outputting a pretty info message.

text - The text to run through and output to the end user.

Returns the string coloured and formatted.

# File lib/acquia_toolbelt/cli/ui.rb, line 30
def info(text)
  puts "#{text}".foreground(:cyan)
end
output_table(title = '', headings, rows) click to toggle source

Internal: Render a CLI table.

title - The title to display at the top of the table. heading - Header rows for the table. rows - An array of the row data to output.

Outputs a table to the end user.

# File lib/acquia_toolbelt/cli/ui.rb, line 50
def output_table(title = '', headings, rows)
  table = Terminal::Table.new
  table.title = title unless title.empty?
  table.rows = rows
  table.headings = headings
  table.style = {
    :padding_left  => 1,
    :padding_right => 1
  }

  puts table
end
success(text) click to toggle source

text - The text to run through and output to the end user.

Returns the string coloured and formatted.

# File lib/acquia_toolbelt/cli/ui.rb, line 12
def success(text)
  puts "#{text}".foreground(:green)
end