SamSaffron/MiniProfiler — pull request #71 by rtomayko (2012-09-14 00:21:53+00:00)
Title: Avoid deprecated Proc#bind when instance_exec available

`Proc#bind` is deprecated in https://github.com/rails/rails/pull/5552 due to some pretty serious GC issues with the implementation. In addition to just being something to avoid, its dumping one of these messages per template in the server logs:

DEPRECATION WARNING: Proc#bind is deprecated and will be removed in future versions. (called
from block in profile_method at vendor/gems/ruby/1.9.1/gems/rack-mini-profiler-0.1.20/lib/mini_profiler/profiling_methods.rb:74)

This change uses `Object#instance_exec` (Ruby >= 1.9) instead when available. `Proc#bind` is still used in environments that don't have `instance_exec`.