Created
July 26, 2016 01:04
-
-
Save acuppy/7083de1ce2be1db2a0bb324ee3b19f8b to your computer and use it in GitHub Desktop.
An example of how to tap into Rake and run a log line prior to every Rake Task run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI:
parse_task_string
is part ofRake::Application