summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-05-14 11:36:20 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-05-15 10:01:26 +1000
commitfb957ccb6636ce86bd98c141d5818c54bc0d4659 (patch)
tree4ee5fd0ddc1e09dbb72bc06e6fcfd0caeee04f38 /lib/puppet/parser
parentc6084093e67b1e415e49c192b3ac6f6b9aebc4ba (diff)
downloadpuppet-fb957ccb6636ce86bd98c141d5818c54bc0d4659.tar.gz
puppet-fb957ccb6636ce86bd98c141d5818c54bc0d4659.tar.xz
puppet-fb957ccb6636ce86bd98c141d5818c54bc0d4659.zip
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 <luke@madstop.com>
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/files.rb16
1 files changed, 8 insertions, 8 deletions
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,