From fb957ccb6636ce86bd98c141d5818c54bc0d4659 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 14 May 2009 11:36:20 -0500 Subject: Modules now can find their own paths Previously, when you created a module you had to specify the path. Now Module instances can use the module path to look up their paths, and there are methods for determining whether the module is present (if the path is present). Also cleaned up the methods for figuring out what's in the module (plugins, etc.). Signed-off-by: Luke Kanies --- lib/puppet/parser/files.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/files.rb b/lib/puppet/parser/files.rb index 2cd163f97..ca4fb4f10 100644 --- a/lib/puppet/parser/files.rb +++ b/lib/puppet/parser/files.rb @@ -16,16 +16,16 @@ module Puppet::Parser::Files def find_manifests(start, options = {}) cwd = options[:cwd] || Dir.getwd module_name, pattern = split_file_path(start) - if module_name and mod = Puppet::Module.find(module_name, options[:environment]) + if mod = Puppet::Module.find(module_name, options[:environment]) return mod.match_manifests(pattern) - else - abspat = File::expand_path(start, cwd) - files = Dir.glob(abspat).reject { |f| FileTest.directory?(f) } - if files.size == 0 - files = Dir.glob(abspat + ".pp").reject { |f| FileTest.directory?(f) } - end - return files end + + abspat = File::expand_path(start, cwd) + files = Dir.glob(abspat).reject { |f| FileTest.directory?(f) } + if files.size == 0 + files = Dir.glob(abspat + ".pp").reject { |f| FileTest.directory?(f) } + end + return files end # Find the concrete file denoted by +file+. If +file+ is absolute, -- cgit