Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Qualify the rest of the RubyProf references to toplevel since ruby-pr…

…of has an evil Rack::RubyProf class now
  • Loading branch information...
commit ae55f713ad0a738b9b5237fc0ef834fccd78cdf3 1 parent e6621ce
@jeremy jeremy authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/rack/contrib/profiler.rb
View
12 lib/rack/contrib/profiler.rb
@@ -43,10 +43,10 @@ def call(env)
private
def profiling?(env)
- unless RubyProf.running?
+ unless ::RubyProf.running?
request = Rack::Request.new(env.clone)
if mode = request.params.delete('profile')
- if RubyProf.const_defined?(mode.upcase)
+ if ::RubyProf.const_defined?(mode.upcase)
mode
else
env['rack.errors'].write "Invalid RubyProf measure_mode: " +
@@ -58,10 +58,10 @@ def profiling?(env)
end
def profile(env, mode)
- RubyProf.measure_mode = RubyProf.const_get(mode.upcase)
+ ::RubyProf.measure_mode = ::RubyProf.const_get(mode.upcase)
GC.enable_stats if GC.respond_to?(:enable_stats)
- result = RubyProf.profile do
+ result = ::RubyProf.profile do
@times.times { @app.call(env) }
end
GC.disable_stats if GC.respond_to?(:disable_stats)
@@ -93,8 +93,8 @@ def parse_printer(printer)
printer
else
name = "#{camel_case(printer)}Printer"
- if RubyProf.const_defined?(name)
- RubyProf.const_get(name)
+ if ::RubyProf.const_defined?(name)
+ ::RubyProf.const_get(name)
else
DEFAULT_PRINTER
end
Please sign in to comment.
Something went wrong with that request. Please try again.