Project

General

Profile

Bug #119 ยป 0001-Recurse-into-module-directories-when-looking-for-cla.patch

Frank Sweetser, 12/07/2009 06:56 PM

View differences:

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
    (1-1/1)