Method: Puppet::Util::Autoload.get_file

Defined in:
lib/puppet/util/autoload.rb

.get_file(name, env) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get the correct file to load for a given path returns nil if no file is found



113
114
115
116
117
# File 'lib/puppet/util/autoload.rb', line 113

def get_file(name, env)
  name += '.rb' unless name =~ /\.rb$/
  path = search_directories(env).find { |dir| Puppet::FileSystem.exist?(File.join(dir, name)) }
  path and File.join(path, name)
end