summaryrefslogtreecommitdiffstats
path: root/lib/puppet/module.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-24 23:17:57 -0600
committerLuke Kanies <luke@madstop.com>2007-11-24 23:17:57 -0600
commit4e9c39e6a7ca5ebb9d8343d1e6b835e24c257200 (patch)
tree431872a6909aab930d4585d1b4b4d730f4bfb703 /lib/puppet/module.rb
parent7eb09abebb91a567b081a651fce179acfadfb7c0 (diff)
parentb575d1585322709604f558742dfd6f5ce412b342 (diff)
downloadpuppet-4e9c39e6a7ca5ebb9d8343d1e6b835e24c257200.tar.gz
puppet-4e9c39e6a7ca5ebb9d8343d1e6b835e24c257200.tar.xz
puppet-4e9c39e6a7ca5ebb9d8343d1e6b835e24c257200.zip
Merge branch 'plugins_mount', fixing #891.
Conflicts: CHANGELOG
Diffstat (limited to 'lib/puppet/module.rb')
-rw-r--r--lib/puppet/module.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb
index 45860c74d..54212710d 100644
--- a/lib/puppet/module.rb
+++ b/lib/puppet/module.rb
@@ -4,7 +4,7 @@ class Puppet::Module
TEMPLATES = "templates"
FILES = "files"
MANIFESTS = "manifests"
-
+
# Return an array of paths by splitting the +modulepath+ config
# parameter. Only consider paths that are absolute and existing
# directories
@@ -35,6 +35,21 @@ class Puppet::Module
return self.new(modname, modpath)
end
+ # Return an array of the full path of every subdirectory in each
+ # directory in the modulepath.
+ def self.all(environment = nil)
+ modulepath(environment).map do |mp|
+ Dir.new(mp).map do |modfile|
+ modpath = File.join(mp, modfile)
+ unless modfile == '.' or modfile == '..' or !File.directory?(modpath)
+ modpath
+ else
+ nil
+ end
+ end
+ end.flatten.compact
+ end
+
# Instance methods
# Find the concrete file denoted by +file+. If +file+ is absolute,