Module: Concordion::LoaderHelper

Included in:
Invoker, Reader
Defined in:
lib/concordion/loader_helper.rb

Instance Method Summary collapse

Instance Method Details

#path_for(filename) ⇒ Object

Raises:

  • (RuntimeError)


7
8
9
10
11
12
13
14
15
# File 'lib/concordion/loader_helper.rb', line 7

def path_for(filename)
  return filename if File.exists?(filename)

  $LOAD_PATH.each do |path|
    candidate = "#{path}/#{filename}"
    return candidate if File.exists?(candidate)
  end
  raise RuntimeError.new("could not find '#{filename}' on the system load path")
end