Class Spork::Diagnoser
In: lib/spork/diagnoser.rb
Parent: Object

The Diagnoser hooks into load and require and keeps track of when files are required / loaded, and who loaded them. It‘s used when you run spork —diagnose

Example

 Spork::Diagnoser.install_hook!('/path/env.rb', '/path')
 require '/path/to/env.rb'
 Spork::Diagnoser.output_results(STDOUT)

Methods

External Aliases

require -> require_without_diagnoser
load -> load_without_diagnoser
require_without_diagnoser -> require
load_without_diagnoser -> load

Public Class methods

Installs the diagnoser hook into Kernel#require and Kernel#load

Parameters

  • entry_file - The file that is used to load the project. Used to filter the backtrace so anything that happens after it is hidden.
  • dir - The project directory. Any file loaded outside of this directory will not be logged.

output the results of a diagnostic run.

Parameters

  • stdout - An IO stream to output the results to.

Uninstall the hook. Generally useful only for testing the Diagnoser.

[Validate]