Creating custom lib/tasks folder for rake files?

A

andreux

How can I setup my own lib/tasks folder (similar to rails) so that all
tasks in this folder are available when running rake?

Everything I've tried so far has been unsuccessful. I get errors even
when trying to require a single .rake file from my main Rakefile:

require 'sitemap.rake'
rake aborted!
no such file to load -- sitemap.rake

Any suggestions?
 
C

Chris Lowis

Any suggestions?

Something like this at the top of your Rakefile, perhaps?

Dir["#{File.dirname(__FILE__)}/lib/tasks/*.rake"].sort.each { |ext| load
ext }


Chris
 
H

Hassan Schroeder

How can I setup my own lib/tasks folder (similar to rails) so that all
tasks in this folder are available when running rake?

`rake --help` is pretty informative :)

The output includes:

-g, --system Using system wide (global)
rakefiles (usually '~/.rake/*.rake').

:: as well as some other interesting possibilities.

HTH!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top