Forum: Ruby rake variables

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
149379873fe2cb70e550c6bff8fedd0c?d=identicon&s=25 Jeff Schwab (Guest)
on 2009-04-25 05:05
(Received via mailing list)
I'm a rake beginner with a couple of questions:

(1) Is there any way to set rake options from the within the Rakefile,
as though they had been specified on the command-line?  I always want to
run a particular Rakefile with particular options (e.g. -s).

(2) It seems rake either gives way too much info, or not enough.  I want
Make-like behavior:  Don't bother telling me about stuff you didn't have
to build, but do tell me when you're actually building something.

I see the potential, and I like it, but I'm starting to feel like I need
a separate Makefile just to run rake.
149379873fe2cb70e550c6bff8fedd0c?d=identicon&s=25 Jeff Schwab (Guest)
on 2009-04-27 15:21
(Received via mailing list)
Jeff Schwab wrote:
> I see the potential, and I like it, but I'm starting to feel like I need
> a separate Makefile just to run rake.

Can anyone recommend a more appropriate forum for these questions?
149379873fe2cb70e550c6bff8fedd0c?d=identicon&s=25 Jeff Schwab (Guest)
on 2009-05-10 16:22
(Received via mailing list)
Jeff Schwab wrote:

> (1) Is there any way to set rake options from the within the Rakefile,
> as though they had been specified on the command-line?

The short answer to this is no.  The long answer is that you can use
rake as a library, and within your "rake replacement" script,
preconfigure Rake.application.options however you so choose.

I've just patched rake with support for a RAKEOPT environment variable:

http://github.com/jeffs/rake/tree/master

$ echo 'task :default do |t| puts t.name end' > Rakefile
$ rake
(in /Users/jeff)
default
$ RAKEOPT=-s rake
default
$
149379873fe2cb70e550c6bff8fedd0c?d=identicon&s=25 Jeff Schwab (Guest)
on 2009-05-26 20:56
(Received via mailing list)
Jeff Schwab wrote:

> I've just patched rake with support for a RAKEOPT environment variable:

Merged into Jim Weirich's mainline:
http://github.com/jimweirich/rake/commits/master

Thank you, Jim.
This topic is locked and can not be replied to.