497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
|
# File 'lib/autobuild/package.rb', line 497
def process_formatting_string(msg, *prefix_style)
prefix = []
suffix = []
msg.split(" ").each do |token|
if token =~ /%s/
suffix << token.gsub(/%s/, name)
elsif suffix.empty?
prefix << token
else
suffix << token
end
end
if suffix.empty?
msg
elsif prefix_style.empty?
(prefix + suffix).join(" ")
else
colorized_prefix = Autobuild.color(prefix.join(" "), *prefix_style)
[colorized_prefix, *suffix].join(" ")
end
end
|