diff options
author | Luke Kanies <luke@madstop.com> | 2009-02-17 17:16:20 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-02-18 22:38:44 -0600 |
commit | 458642b8660c8f0507b1f66b67bade5c60efe64a (patch) | |
tree | bd85a12540ad0711f31767406d7b8ff710f152e6 /lib/puppet | |
parent | eec1caddf0dc431229ceb1741b357a9fefce5c38 (diff) | |
download | puppet-458642b8660c8f0507b1f66b67bade5c60efe64a.tar.gz puppet-458642b8660c8f0507b1f66b67bade5c60efe64a.tar.xz puppet-458642b8660c8f0507b1f66b67bade5c60efe64a.zip |
Supporting multiple paths for searching for files.
This is, once again, used for plugins, which needs
to search across multiple modules' plugin directories.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/file_serving/terminus_helper.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/puppet/file_serving/terminus_helper.rb b/lib/puppet/file_serving/terminus_helper.rb index b51e27297..5b993c9e0 100644 --- a/lib/puppet/file_serving/terminus_helper.rb +++ b/lib/puppet/file_serving/terminus_helper.rb @@ -8,7 +8,7 @@ require 'puppet/file_serving/fileset' # Define some common methods for FileServing termini. module Puppet::FileServing::TerminusHelper # Create model instances for all files in a fileset. - def path2instances(request, path) + def path2instances(request, *paths) args = [:links, :ignore, :recurse].inject({}) do |hash, param| if request.options.include?(param) # use 'include?' so the values can be false hash[param] = request.options[param] @@ -19,8 +19,12 @@ module Puppet::FileServing::TerminusHelper hash[param] = false if hash[param] == "false" hash end - Puppet::FileServing::Fileset.new(path, args).files.collect do |file| - inst = model.new(path, :relative_path => file) + filesets = paths.collect do |path| + Puppet::FileServing::Fileset.new(path, args) + end + + Puppet::FileServing::Fileset.merge(*filesets).collect do |file, base_path| + inst = model.new(base_path, :relative_path => file) inst.links = request.options[:links] if request.options[:links] inst.collect inst |