2012-11-29 14:16:46 -05:00
|
|
|
module Rake
|
2014-07-14 23:07:37 -04:00
|
|
|
module TraceOutput # :nodoc: all
|
2012-11-29 14:16:46 -05: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 17:35:01 -04:00
|
|
|
output = strings.map { |s|
|
|
|
|
next if s.nil?
|
|
|
|
s =~ /#{sep}$/ ? s : s + sep
|
|
|
|
}.join
|
2012-11-29 14:16:46 -05:00
|
|
|
end
|
|
|
|
out.print(output)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|