[Rake-devel] Passing Command Line Values to a Rakefile?

Charles F. I. Savage cfis at interserv.com
Sat Aug 20 18:46:53 EDT 2005


Excellent.   Thanks.

Charlie

Jim Weirich wrote:
> On Saturday 20 August 2005 02:49 am, Charles F. I. Savage wrote:
>   
>> However, I'd much rather be able to pass in the database name to the
>> script.  Thus something like this from a shell script or other Ruby code:
>>
>> rake -f MyRakefile --options="database=test"
>> rake -f MyRakefile --options="database=deploy"
>> rake -f MyRakefile --options="database=production"
>>     
>
> You can say: 
>     rake -f MyRakefile DATABASE=production
>
> The specified value will be placed in the ENV hash (e.g. ENV['DATABASE']).
>
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2781 bytes
Desc: S/MIME Cryptographic Signature
Url : http://rubyforge.org/pipermail/rake-devel/attachments/20050820/422225cc/smime.bin


More information about the Rake-devel mailing list