module Kernel

A Kernel hack that adds require timing to find require problems in app.

Public Instance Methods

require(file) click to toggle source
# File lib/require_bench.rb, line 48
def require(file)
  file_path = file.to_s

  # Global $ variable, which is always truthy while inside the hack, is to
  #   prevent a scenario that might result in infinite recursion.
  return require_without_timing(file_path) if $require_bench_semaphore
  if RequireBench::SKIP_PATTERN && file_path =~ RequireBench::SKIP_PATTERN
    return require_without_timing(file_path)
  end

  RequireBench.require_with_timing(file_path)
end
Also aliased as: require_without_timing
require_without_timing(file)
Alias for: require