Skip to content

Instantly share code, notes, and snippets.

@dmolesUC
Last active October 16, 2020 23:45
Show Gist options
  • Save dmolesUC/f275d157d0e202f5455d1b14c273b0ed to your computer and use it in GitHub Desktop.
Save dmolesUC/f275d157d0e202f5455d1b14c273b0ed to your computer and use it in GitHub Desktop.
Monkey-patch Rake::Task to show all task invocations
# 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