public
Description: Puppet is a declarative language for expressing system configuration, a client and server for distributing it, and a library for realizing the configuration.
Homepage: http://reductivelabs.com/trac/puppet/
Clone URL: git://github.com/shadoi/puppet.git
Add ".pp" as a default file extension for classes to load, this gets around the 
problem of having a directory name the same as a class file.
Blake Barnett (author)
Mon Mar 31 18:14:04 -0700 2008
commit  900e4814482d02f6c000f992aa891d06ee8273a2
tree    95fff26f7235cb71a1bafcc0915dde7da46a20fc
parent  2e88af1662123604d4fb8750da53de3595b6b5cc
...
97
98
99
 
 
 
100
101
102
...
223
224
225
226
 
227
228
229
...
97
98
99
100
101
102
103
104
105
...
226
227
228
 
229
230
231
232
0
@@ -97,6 +97,9 @@ class Puppet::Parser::Parser
0
         end
0
         if @files.detect { |f| f.file == file }
0
             raise Puppet::AlreadyImportedError.new("Import loop detected")
0
+        elsif FileTest.directory?(file)    
0
+            #moan and skip it
0
+            Puppet.debug("Tried to import a directory: '%s'" % file)
0
         else
0
             @files << Puppet::Util::LoadedFile.new(file)
0
             @lexer.file = file
0
@@ -223,7 +226,7 @@ class Puppet::Parser::Parser
0
     # Try to load a class, since we could not find it.
0
     def load(classname)
0
         return false if classname == ""
0
-        filename = classname.gsub("::", File::SEPARATOR)
0
+        filename = classname.gsub("::", File::SEPARATOR) + ".pp"
0
 
0
         # First try to load the top-level module
0
         mod = filename.scan(/^[\w-]+/).shift

Comments