instance method
define_run_method
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.2.3 PrivateSignature
define_run_method(script_path)
No documentation comment.
Parameters
-
script_pathreq
Source
# File actionpack/lib/action_controller/request_profiler.rb, line 42
def define_run_method(script_path)
script = File.read(script_path)
source = <<-end_source
def run(profiling = false)
if profiling
RubyProf.resume do
#{script}
end
else
#{script}
end
old_request_count = request_count
reset!
self.request_count = old_request_count
end
end_source
instance_eval source, script_path, 1
end
Defined in actionpack/lib/action_controller/request_profiler.rb line 42
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::RequestProfiler::Sandbox