class ThemeBandit::Log

Attributes

message[RW]

Public Class Methods

colorize(text, color_code) click to toggle source
# File lib/theme_bandit/util/log.rb, line 7
def colorize(text, color_code)
  $stdout.write "\e[#{color_code}m#{text}\e[0m\n"
end
green(text) click to toggle source
# File lib/theme_bandit/util/log.rb, line 27
def green(text)
  @message = text
  colorize(text, 32)
end
patch(old_file_name, new_file_name) click to toggle source
# File lib/theme_bandit/util/log.rb, line 17
def patch(old_file_name, new_file_name)
  @message = "#{old_file_name} failed to download. Manually patch .theme/public/*/#{new_file_name} in its place"
  logger.error @message
end
red(text) click to toggle source
# File lib/theme_bandit/util/log.rb, line 11
def red(text)
  @message = text
  colorize(text, 31)
  logger.error text
end
yellow(text) click to toggle source
# File lib/theme_bandit/util/log.rb, line 22
def yellow(text)
  @message = text
  colorize(text, 33)
end

Private Class Methods

logger() click to toggle source
# File lib/theme_bandit/util/log.rb, line 34
def logger
  @logger ||= new 'error.log'
end