Last active
October 16, 2020 23:45
-
-
Save dmolesUC/f275d157d0e202f5455d1b14c273b0ed to your computer and use it in GitHub Desktop.
Monkey-patch Rake::Task to show all task invocations
This file contains 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
# In your Rakefile (after Rails.application.load_tasks, in a Rails project): | |
module TaskExtensions | |
def invoke | |
(@logger ||= Logger.new($stderr)).tap do |logger| | |
logger.info("invoke #{self.name}") # note: you can also dump environment variables etc. here | |
end | |
super | |
end | |
end | |
module Rake | |
class Task | |
prepend TaskExtensions | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment