Bug #119 ยป 0001-Recurse-into-module-directories-when-looking-for-cla.patch
app/models/puppetclass.rb | ||
---|---|---|
# returns an array of puppetclasses objects
|
||
def self.scanForClasses(path)
|
||
klasses=Array.new
|
||
Dir.glob("#{path}/*/manifests/*.pp").each do |manifest|
|
||
Dir.glob("#{path}/*/manifests/**/*.pp").each do |manifest|
|
||
File.read(manifest).each_line do |line|
|
||
klass=line.match(/^class (\S+).*\{/)
|
||
klasses << Puppetclass.find_or_create_by_name(klass[1]) if klass
|