Token replacement & rake

R

Rob Lucas

Hi,

I need to create some method of automating builds of my rails web app.
It needs to be built repetitively with minor differences specified in a
config file. I was planning to use rake for this, but I guess it will
need some kind of token replacement.

Does anyone know of any way of doing this kind of thing with rake?

Thanks,

Rob.
 
T

Tim Pease

Hi,

I need to create some method of automating builds of my rails web app.
It needs to be built repetitively with minor differences specified
in a
config file. I was planning to use rake for this, but I guess it will
need some kind of token replacement.

Does anyone know of any way of doing this kind of thing with rake?

Use a combination of rake and ERB. Write a rake task that uses ERB
to modify your config files as needed.

Blessings,
TwP
 
R

Ryan Davis

I need to create some method of automating builds of my rails web app.
It needs to be built repetitively with minor differences specified
in a
config file. I was planning to use rake for this, but I guess it will
need some kind of token replacement.

I'm assuming you mean that your rake rules should change based on the
config file? Is it the dependencies or rule names or rule actions
that should change? Either way, it should be easy:

config = eval File.read("config/build.conf.rb")

task "compile-#{config["stage"]}" => "do-#{config["stage"]}" do
case config["flag"]
when # ...
# ...
end
end
 

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

Forum statistics

Threads
474,269
Messages
2,571,338
Members
48,027
Latest member
MeaganThur

Latest Threads

Top