summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/autoload.rb
diff options
context:
space:
mode:
authorJeffrey J McCune <jeff.mccune@northstarlabs.net>2007-08-14 09:50:42 -0400
committerJeffrey J McCune <jeff.mccune@northstarlabs.net>2007-08-14 09:50:42 -0400
commit58e3855bb1c98e45f7e366d0f1fc6d834e0e5e43 (patch)
treee76dfcaf9411eb2764e407a8bf93f03fc26bd82b /lib/puppet/util/autoload.rb
parentab42534ae243c24c8c702e38195a954ab52eaed9 (diff)
downloadpuppet-58e3855bb1c98e45f7e366d0f1fc6d834e0e5e43.tar.gz
puppet-58e3855bb1c98e45f7e366d0f1fc6d834e0e5e43.tar.xz
puppet-58e3855bb1c98e45f7e366d0f1fc6d834e0e5e43.zip
Added optional per-module lib directory.
Puppet now looks for a lib directory inside each module bundle, and adds the directory to the list searched by Puppet::Util::Autoload. The intent is to facilitate more sophisticated virtual types and flexibility within modules.
Diffstat (limited to 'lib/puppet/util/autoload.rb')
-rw-r--r--lib/puppet/util/autoload.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb
index 42aa56c32..be9e14671 100644
--- a/lib/puppet/util/autoload.rb
+++ b/lib/puppet/util/autoload.rb
@@ -141,7 +141,13 @@ class Puppet::Util::Autoload
# The list of directories to search through for loadable plugins.
def searchpath
- [Puppet[:libdir], $:].flatten
+ # 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|
+ FileTest.directory?(f)
+ end
+ end.flatten
+ [module_lib_dirs, Puppet[:libdir], $:].flatten
end
end