2012-11-29 19:16:46 +00:00
|
|
|
module Rake
|
2014-07-15 03:07:37 +00:00
|
|
|
module TraceOutput # :nodoc: all
|
2012-11-29 19:16:46 +00:00
|
|
|
|
|
|
|
# Write trace output to output stream +out+.
|
|
|
|
#
|
|
|
|
# The write is done as a single IO call (to print) to lessen the
|
|
|
|
# chance that the trace output is interrupted by other tasks also
|
|
|
|
# producing output.
|
|
|
|
def trace_on(out, *strings)
|
|
|
|
sep = $\ || "\n"
|
|
|
|
if strings.empty?
|
|
|
|
output = sep
|
|
|
|
else
|
2013-10-11 21:35:01 +00:00
|
|
|
output = strings.map { |s|
|
|
|
|
next if s.nil?
|
|
|
|
s =~ /#{sep}$/ ? s : s + sep
|
|
|
|
}.join
|
2012-11-29 19:16:46 +00:00
|
|
|
end
|
|
|
|
out.print(output)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|