module Kernel

Public Instance Methods

load(name, wrap = false) click to toggle source
# File lib/ru-slow/kernel.rb, line 19
def load(name, wrap = false)
  # Don't benchmark requires outside of this project
  return old_load(name) if name.start_with?('/')

  # Profile the result
  RuSlow.add("load '#{name}'", Benchmark.measure { old_load(name, wrap) })

  # ALways return true
  return true
end
Also aliased as: old_load
old_load(name, wrap = false)
Alias for: load
old_require(name)
Alias for: require
require(name) click to toggle source
# File lib/ru-slow/kernel.rb, line 3
def require(name)
  # Don't benchmark requires outside of this project
  return old_require(name) if name.start_with?('/')

  # Store a local variable for the result of the benchmark, so the original
  # method can return true/false as it would have.
  old_result = false

  # Profile the result
  RuSlow.add("require '#{name}'", Benchmark.measure { old_result = old_require(name) })

  # Return the original result
  return old_result
end
Also aliased as: old_require