Search code examples
rubyrake

Can --silent be set in the Rakefile?


I want --silent in the Rakefile, because I am requiring rake, not invoking it from the command line, and I want it to shut up about the directory it is in:

(in some/directory)

^^ stop that, Rake. It is annoying. Don't you have better things to do?

Is it possible to set --silent in the Rakefile? How?


Solution

  • I answered my own question by reading the rake source code. I could have been more patient before posting to Stack Overflow, but in case somebody else is looking, you can use RAKEOPT:

    ENV['RAKEOPT'] = "--silent"
    

    It's not in the Rakefile -- it's in the Ruby code where I load the rake environment, which is good enough for me.