Instead of writing everything directly in the .rake. Define a ruby module with methods used by the rakefile.
Attach a file by drag & drop or click to upload