[Rake-devel] require not .rb

Jim Weirich jim.weirich at gmail.com
Wed Jan 9 08:37:15 EST 2008

On Jan 9, 2008, at 8:33 AM, Daniel Brumbaugh Keeney wrote:

> Is there some way to require a file that doesn't end in `.rb'  
> within a Rakefile?
> Thanks.

You can use load rather than require.  You will need to give a path  
to the file and include the extension.  Also load is not idempotent  
like require (i.e. multiple loads on the same file will actually load  
the file multiple times).

And Rake is just plain ruby, so any other exotic technique that works  
in Ruby will work with rake too (e.g. explicitly reading and evaling  
the file contents).

-- Jim Weirich
-- jim.weirich at gmail.com

More information about the Rake-devel mailing list