summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/autoload.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-02-18 09:38:32 -0600
committerLuke Kanies <luke@madstop.com>2008-02-18 09:38:32 -0600
commita53106cf08c28e996502cba703f64944250a4b29 (patch)
tree4dee55340a4d91083e940fecb9087ecfaa7c279f /lib/puppet/util/autoload.rb
parentbe58bb5c4bc19e59685e0a8953eaf2d3b7844110 (diff)
parent62d7616a457f33eb660454fcdcefe8dab84522c0 (diff)
downloadpuppet-a53106cf08c28e996502cba703f64944250a4b29.tar.gz
puppet-a53106cf08c28e996502cba703f64944250a4b29.tar.xz
puppet-a53106cf08c28e996502cba703f64944250a4b29.zip
Merge branch '0.24.x'
Conflicts: CHANGELOG man/man8/puppet.8
Diffstat (limited to 'lib/puppet/util/autoload.rb')
-rw-r--r--lib/puppet/util/autoload.rb10
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