71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/reporting.rb', line 71
def message(type,msg,color = nil)
clear_line if self.respond_to? :clear_line
ostring = case color
when :red ; "[31m"
when :green ; "[32m"
when nil ; ''
else raise
end
msg.chomp!
if msg =~ /\n/
ostring += "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
ostring += "+++++ #{type}: (Multi-line) +++++++++++++++++++++++++++++++++++++++\n"
ostring += "#{msg}\n"
ostring += "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
else
ostring += "#{type}: #{msg}"
end
ostring += "[0m" if color
puts ostring
ostring
end
|