module Sambot::UI
Public Class Methods
ask(msg)
click to toggle source
# File lib/sambot/ui.rb, line 12 def self.ask(msg) Thor.new.ask(msg) unless @@silent end
ask_password(msg)
click to toggle source
# File lib/sambot/ui.rb, line 16 def self.ask_password(msg) Thor.new.ask(msg, echo: false) unless @@silent end
debug(msg)
click to toggle source
# File lib/sambot/ui.rb, line 25 def self.debug(msg) date_format = DateTime.now.strftime('%Y-%m-%d %H:%M:%S') Thor.new.say("#{date_format} [D] #{msg}", :gray) unless @@silent end
error(msg)
click to toggle source
# File lib/sambot/ui.rb, line 35 def self.error(msg) date_format = DateTime.now.strftime('%Y-%m-%d %H:%M:%S') Thor.new.say("#{date_format} [E] #{msg}", :red) unless @@silent end
info(msg)
click to toggle source
# File lib/sambot/ui.rb, line 30 def self.info(msg) date_format = DateTime.now.strftime('%Y-%m-%d %H:%M:%S') Thor.new.say("#{date_format} [I] #{msg}", :green) unless @@silent end
silent=(value)
click to toggle source
# File lib/sambot/ui.rb, line 8 def self.silent=(value) @@silent = value end
warn(msg)
click to toggle source
# File lib/sambot/ui.rb, line 20 def self.warn(msg) date_format = DateTime.now.strftime('%Y-%m-%d %H:%M:%S') Thor.new.say("#{date_format} [W] #{msg}", :yellow) unless @@silent end