Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
An example of how to tap into Rake and run a log line prior to every Rake Task run.
# lib/rake/logging.rb
require 'rake'
module Rake
module Logging
def invoke_task *args
puts "Running: #{parse_task_string args.first}" # ...or do whatever
super
end
end
end
Rake::Application.class_eval do
prepend Rake::Logging
end
@acuppy

This comment has been minimized.

Copy link
Owner Author

@acuppy acuppy commented Jul 26, 2016

FYI: parse_task_string is part of Rake::Application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment