method

define_run_method

rails latest stable - Class: ActionController::RequestProfiler::Sandbox

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.2.1) is shown here.

define_run_method(script_path)
private

No documentation available.

# File actionpack/lib/action_controller/request_profiler.rb, line 42
        def define_run_method(script_path)
          script = File.read(script_path)

          source = "def run(profiling = false)\nif profiling\nRubyProf.resume do\n\#{script}\nend\nelse\n\#{script}\nend\n\nold_request_count = request_count\nreset!\nself.request_count = old_request_count\nend\n"

          instance_eval source, script_path, 1
        end