Earlier this week I was pair programming with Obie, and we wanted to transfer a bunch of data from one service provider into another.
As we talked through the problem, we started working through a rake task to get the job done.
We eventually reached a point where it would’ve been helpful to be able to override some of the data that was provided by Provider A, so that we could ensure consistency amongst all the data.
At that point I suggested we use ‘gets’ in the terminal, but wondered aloud whether you could do that in a rake task.
To which Obie replied, “It’s all Ruby.”
It’s all Ruby indeed, because that’s exactly what we did.
Below I’ll create a simple rake task to illustrate the concept.
The following grabs event data from Provider A and transfers it to a mailing list at Provider B: