diff options
| author | Jack Nagel | 2014-06-25 11:19:00 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-06-25 11:19:00 -0500 |
| commit | 51326e0b638b4b486bd5216ca7b456ae5ea0d3da (patch) | |
| tree | 7cad26327941eb013235fd219f5fb8bc77d37f51 | |
| parent | e24c5a750ada27bc0d949854cc8a523329ce9a35 (diff) | |
| download | brew-51326e0b638b4b486bd5216ca7b456ae5ea0d3da.tar.bz2 | |
Extend with a module instead of aliasing on the singleton class
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 59bf59c45..0bf9b89ef 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -1151,15 +1151,14 @@ module Homebrew end def inject_dump_stats checks - class << checks - alias_method :oldsend, :send - def send method + checks.extend Module.new { + def send(method, *) time = Time.now - oldsend(method) + super ensure $times[method] = Time.now - time end - end + } $times = {} at_exit { puts $times.sort_by{|k, v| v }.map{|k, v| "#{k}: #{v}"} |
