2008-12-29 07:10:05 +00:00
|
|
|
class String
|
|
|
|
def /(other)
|
|
|
|
(Pathname.new(self) + other).to_s
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
module ColorfulMessages
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-12-29 07:10:05 +00:00
|
|
|
# red
|
|
|
|
def error(*messages)
|
|
|
|
puts messages.map { |msg| "\033[1;31m#{msg}\033[0m" }
|
|
|
|
end
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-12-29 07:10:05 +00:00
|
|
|
# yellow
|
|
|
|
def warning(*messages)
|
|
|
|
puts messages.map { |msg| "\033[1;33m#{msg}\033[0m" }
|
|
|
|
end
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-12-29 07:10:05 +00:00
|
|
|
# green
|
|
|
|
def success(*messages)
|
|
|
|
puts messages.map { |msg| "\033[1;32m#{msg}\033[0m" }
|
|
|
|
end
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-12-29 07:10:05 +00:00
|
|
|
alias_method :message, :success
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-12-29 07:10:05 +00:00
|
|
|
# magenta
|
|
|
|
def note(*messages)
|
|
|
|
puts messages.map { |msg| "\033[1;35m#{msg}\033[0m" }
|
|
|
|
end
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-12-29 07:10:05 +00:00
|
|
|
# blue
|
|
|
|
def info(*messages)
|
|
|
|
puts messages.map { |msg| "\033[1;34m#{msg}\033[0m" }
|
|
|
|
end
|
2009-04-08 00:30:12 +00:00
|
|
|
|
2008-12-29 07:10:05 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
module ThorUI
|
|
|
|
extend ColorfulMessages
|
|
|
|
end
|