tags:

views:

225

answers:

1

Hi,

Does Rake have anything built in for replacing strings inside files and such or is it best to use bash commands inside 'sh', or use Ruby's own file manipulation functionality?

Regards,

Chris

+3  A: 

Rake doesn't provide anything special in regards to string replacement, but it's a Ruby script; you can use anything you could in any other script. Whether doing it in Ruby is better than using other tools is a matter of picking the best tool for the job.

Keep in mind, though, that if you plan to distribute your source and you use external tools, then those tools become dependencies for your software. If you're requiring something uncommon just for the build, it might be worth rewriting it yourself.

Pesto