Created
January 9, 2019 10:36
-
-
Save apetrov/c060c2ab034ad4d6368efbfe8c2ffc26 to your computer and use it in GitHub Desktop.
Extending rake trace
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
rake -t db:migrate |
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
root@0f285b5c68a3:/app# rake -t db:migrate | |
** Invoke db:migrate (first_time) | |
** Invoke db:load_config (first_time) | |
** Invoke environment (first_time) | |
environment #<Proc:0x000055887e4bb3b8@/usr/local/bundle/gems/railties-5.2.0/lib/rails/application.rb:517> | |
** Execute environment | |
db:load_config #<Proc:0x000055887cb20480@/usr/local/bundle/gems/activerecord-5.2.0/lib/active_record/railtie.rb:38> | |
db:load_config #<Proc:0x000055887c95ba50@/usr/local/bundle/gems/activerecord-5.2.0/lib/active_record/railties/databases.rake:16> | |
** Execute db:load_config | |
db:migrate #<Proc:0x000055887c8fdbf8@/usr/local/bundle/gems/activerecord-5.2.0/lib/active_record/railties/databases.rake:59> | |
** Execute db:migrate | |
** Invoke db:_dump (first_time) | |
db:_dump #<Proc:0x000055887c8e7a38@/usr/local/bundle/gems/activerecord-5.2.0/lib/active_record/railties/databases.rake:65> | |
** Execute db:_dump | |
** Invoke db:schema:dump (first_time) | |
** Invoke db:load_config | |
db:schema:dump #<Proc:0x000055887c7e7a70@/usr/local/bundle/gems/activerecord-5.2.0/lib/active_record/railties/databases.rake:247> | |
** Execute db:schema:dump |
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
# Adding source locations to rake trace | |
class Rake::Task | |
def execute_with_actions_logs(args=nil) | |
@actions.each do |t| | |
if application.options.trace | |
puts "#{name} #{t.inspect}" | |
end | |
end | |
execute_without_actions_logs(args) | |
end | |
alias_method :execute_without_actions_logs, :execute | |
alias_method :execute, :execute_with_actions_logs | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment