class ArsenalConsole::Colorize
Public Class Methods
admin()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 59 def self.admin return "\x1b[37;41m[ADMIN]\x1b[0m" end
analytics()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 15 def self.analytics return "\x1b[30;42m[ANALYTICS]\x1b[0m" end
api()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 67 def self.api return "\x1b[34;45m[API]\x1b[0m" end
cart()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 19 def self.cart return "\x1b[35;42m[CART]\x1b[0m" end
custom(text = "CUSTOM", text_color = nil, background_color = nil)
click to toggle source
# File lib/arsenal_console/colorize.rb, line 79 def self.custom(text = "CUSTOM", text_color = nil, background_color = nil) if text_color == nil && background_color == nil return "#{text}" else text_color_code = case text_color when "black" then "30" when "red" then "31" when "green" then "32" when "yellow" then "33" when "blue" then "34" when "magenta" then "35" when "cyan" then "36" when "white" then "37" else false end background_color_code = case background_color when "black" then "40" when "red" then "41" when "green" then "42" when "yellow" then "43" when "blue" then "44" when "magenta" then "45" when "cyan" then "46" when "white" then "47" else false end if text_color_code == false && background_color_code == false return "#{text}" else message = "\x1b[" if text_color_code message << text_color_code if background_color_code message << ";#{background_color_code}" end elsif background_color_code message << "#{background_color_code}" end message << "m#{text}\x1b[0m" return message end end end
demo()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 123 def self.demo puts "#{self.successful}\n#{self.failed}\n#{self.analytics}\n#{self.cart}\n#{self.devise}\n#{self.email}\n#{self.sms}\n#{self.phone}\n#{self.video}\n#{self.fax}\n#{self.stripe}\n#{self.paypal}\n#{self.user}\n#{self.admin}\n#{self.system}\n#{self.api}\n#{self.webhook}\n#{self.test}\n#{self.custom} (NOTE: No Options Set)\n\n" end
devise()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 23 def self.devise return "\x1b[37;44m[DEVISE]\x1b[0m" end
email()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 27 def self.email return "\x1b[30;43m[EMAIL]\x1b[0m" end
failed()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 11 def self.failed return "\x1b[31mFAILED\x1b[0m" end
fax()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 43 def self.fax return "\x1b[31;43m[FAX]\x1b[0m" end
help()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 127 def self.help message = "\nTo see all options outputted by Colorize: ArsenalConsole::Colorize.demo\n\n" message << "As an example, to use the #{self.analytics} badge inside your code, you can \"puts\": ArsenalConsole::Colorize.analytics\n\n" message << "Make your own with ArsenalConsole::Colorize.custom by sending vars \"text\", \"text_color\", and \"background_color\"\n" message << "Usable colors: black, red, green, yellow, blue, magenta, cyan, white\n" message << "As an example: ArsenalConsole::Colorize.custom('SOMETHING', 'white', 'black') will show as #{self.custom('SOMETHING', 'white', 'black')}\n\n" puts message end
paypal()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 51 def self.paypal return "\x1b[31;46m[PAYPAL]\x1b[0m" end
phone()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 35 def self.phone return "\x1b[34;43m[PHONE]\x1b[0m" end
sms()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 31 def self.sms return "\x1b[35;43m[SMS]\x1b[0m" end
stripe()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 47 def self.stripe return "\x1b[30;46m[STRIPE]\x1b[0m" end
successful()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 7 def self.successful return "\x1b[32mSUCCESSFUL\x1b[0m" end
system()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 63 def self.system return "\x1b[37;45m[SYSTEM]\x1b[0m" end
test()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 75 def self.test return "\x1b[36;41m[TEST]\x1b[0m" end
user()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 55 def self.user return "\x1b[31;47m[USER]\x1b[0m" end
video()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 39 def self.video return "\x1b[37;43m[VIDEO]\x1b[0m" end
webhook()
click to toggle source
# File lib/arsenal_console/colorize.rb, line 71 def self.webhook return "\x1b[36;45m[WEBHOOK]\x1b[0m" end