diff options
author | James Turnbull <james@lovedthanlost.net> | 2008-02-14 11:24:39 +1100 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-02-14 11:24:39 +1100 |
commit | 95db7702b162615c04a138c5e3a266f3d1dcf36c (patch) | |
tree | dea820d409a2d165f36d58799be4a73ec5934534 /lib/puppet/util/autoload.rb | |
parent | c0d72265a37bffbb0becee0c46511db2a1108899 (diff) | |
parent | 5ef8a3e6eb81c7367f50c9de3ec10a8301b106d1 (diff) | |
download | puppet-95db7702b162615c04a138c5e3a266f3d1dcf36c.tar.gz puppet-95db7702b162615c04a138c5e3a266f3d1dcf36c.tar.xz puppet-95db7702b162615c04a138c5e3a266f3d1dcf36c.zip |
Merge branch '0.24.x' of git://reductivelabs.com/puppet into 0.24.x
Diffstat (limited to 'lib/puppet/util/autoload.rb')
-rw-r--r-- | lib/puppet/util/autoload.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb index a52575522..535d9ef2e 100644 --- a/lib/puppet/util/autoload.rb +++ b/lib/puppet/util/autoload.rb @@ -1,6 +1,9 @@ +require 'puppet/util/warnings' + # Autoload paths, either based on names or all at once. class Puppet::Util::Autoload include Puppet::Util + include Puppet::Util::Warnings @autoloaders = {} @loaded = [] @@ -109,9 +112,8 @@ class Puppet::Util::Autoload Dir.glob("#{dir}/*.rb").each do |file| name = File.basename(file).sub(".rb", '').intern next if loaded?(name) - rubypath = File.join(@path, name.to_s) begin - Kernel.require rubypath + Kernel.require file loaded(name, file) rescue => detail if Puppet[:trace] @@ -123,8 +125,6 @@ class Puppet::Util::Autoload end end - private - # Yield each subdir in turn. def eachdir searchpath.each do |dir| @@ -137,7 +137,7 @@ class Puppet::Util::Autoload def searchpath # JJM: Search for optional lib directories in each module bundle. module_lib_dirs = Puppet[:modulepath].split(":").collect do |d| - Dir.glob("%s/*/lib" % d).select do |f| + Dir.glob("%s/*/{plugins,lib}" % d).select do |f| FileTest.directory?(f) end end.flatten |