Skip to content

Instantly share code, notes, and snippets.

@mks-m
Last active August 29, 2015 13:58
Show Gist options
  • Save mks-m/10116473 to your computer and use it in GitHub Desktop.
Save mks-m/10116473 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'puppet/util/autoload'
class Puppet::Util::Autoload
class << self
def search_directories(env=nil)
@search_directories ||= {}
# cache only after initialization
if Puppet.settings.app_defaults_initialized?
@search_directories[env] ||= search_directories_uncached(env)
else
search_directories_uncached(env)
end
end
def search_directories_uncached(env)
[gem_directories, module_directories(env), libdirs(), $LOAD_PATH].flatten
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment