Posted about 1 month ago. Visible to the public.

Run code before or after an existing Rake task

Before

To run additional code before an existing Rake tasks you can add a dependency like this:

Copy
task :before_task do # runs before :existing_task end Rake::Tasks[:existing_task].enhance [:before_task]

The new dependency will be called after all existing dependencies.

After

To run additional code after an existing Rake tasks, pass a block to enhance:

Copy
Rake::Tasks[:existing_task].enhance do # runs after :existing task end

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Avatar
Henning Koch
Last edit:
about 1 month ago
by Henning Koch
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Henning Koch to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more