Token replacement & rake

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.

On Oct 24, 2007, at 10:34 AM, Rob L. wrote:

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

On Oct 24, 2007, at 12:34 , Rob L. wrote:

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