-----Messaggio originale-----
Da: Ryan Davis [mailto:ryand-ruby / zenspider.com] 
Inviato: luned5 dicembre 2011 21:00
A: ruby-talk ML
Oggetto: Re: rake --dry-run: how to see what sh commands will be run?


On Dec 2, 2011, at 09:14 , La Wi wrote:

> I am trying to set up some rules to build files with locally installed ools. I have no trouble getting my rules to work, and to invoke shell ommands with sh().
> 
> However, what I can't figure out is how to get a display of shell 
> commands without actually excecutiing them. I thought I could run 
> 'rake --dry-run' but that seems to display only the filenames that 
> would be updated.
> 
> I've found that setting 'verbose true' in my Rakefile causes the shell ommands to be displayed as they are executed. And I've found that 
> setting 'nowrite true' does EXACTLY what I want, but I can't figure 
> out how to turn it on via a rake command flag.
> 
> I looked in the rake.rb source (rake-0.8.3), and it LOOKS like 
> --dry-run should set both 'verbose' and 'nowrite' for me. But I can't 
> seem to get actual verbose or dryrun behaviors unless I set them in my
Rakefile.

I'm pulling this completely out of my butt... but you might want to try
something along the lines of:

if Rake.application.trace then
  alias old_sh sh

  def sh(*a)
    old_sh "echo", *a
  end
end

P.S. I would LOVE to see a ruby port of Jam if you were so inclined. For C
projects it is a vastly superior tool. :)



 
 
 --
 Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f
 
 Sponsor:
 Capodanno al parco Oltremare Riccione: Pacchetto hotel 3 stelle in centro + ingresso al parco. 
* Mezza pensione, Internet gratis, animazione per bimbi. Scopri l'offerta!
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid981&d)-12