aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/doctor.rb
diff options
context:
space:
mode:
authorJack Nagel2014-06-25 11:19:00 -0500
committerJack Nagel2014-06-25 11:19:00 -0500
commit63397013616643c6e2d0142307bf49cd2d766689 (patch)
treee2f3f939b6bc652fccffb8cb3963d01c9e0b9112 /Library/Homebrew/cmd/doctor.rb
parent28a12a28ae63081405855f4e083f75c75fa24aac (diff)
downloadhomebrew-63397013616643c6e2d0142307bf49cd2d766689.tar.bz2
Extend with a module instead of aliasing on the singleton class
Diffstat (limited to 'Library/Homebrew/cmd/doctor.rb')
-rw-r--r--Library/Homebrew/cmd/doctor.rb9
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}"}