Hi Eric,
I’m by no means a rake expert but since no-one else has answered;
On 6/3/06, Eric A. [email protected] wrote:
- Is there some reason to prefer
sh %{ls -ltr}
over
sh “ls -ltr”
?
Perhaps so that you can do this;
sh %{grep "long long" *}
without having to escape the double quotes. Just a guess.
Is there a Rakefile idiom for displaying
execution results and also saving them
in a file?
I’d do this;
def tee(output, file_name)
puts output
File.open(file_name, "a") {|f| f << output }
end
task :default do
tee `ls`, "out.log"
end
- A single quote (') in a comment causes a parse
error. Is this a known rake bug? If not,
what’s the best way to report it?
I’m not sure exactly what you mean by this. Are you saying
# this is a comment with a quote '
causes a parse error? Anyway, I’m not sure where to report bugs to
Rake but I’d probably try the devel mailing list;
http://rubyforge.org/mailman/listinfo/rake-devel
They should at least point you in the right direction.
David B. wrote:
sh %{grep “long long” *}
without having to escape the double quotes. Just a guess.
Darn good guess, as it turns out. I was just doing something
similar using rsync in my Rakefile, and was glad I had
encoded %{…} for that very reason.
Is there a Rakefile idiom for displaying
task :default do
tee ls
, “out.log”
end
Doh! Of course. Thanks.
http://rubyforge.org/mailman/listinfo/rake-devel
They should at least point you in the right direction.
Another great tip. Thanks. I was at the Rake site, but
missed that pointer somehow.