# File lib/puppet/parser/compiler.rb, line 33 33: def add_resource(scope, resource) 34: @resources << resource 35: 36: # Note that this will fail if the resource is not unique. 37: @catalog.add_resource(resource) 38: 39: # And in the resource graph. At some point, this might supercede 40: # the global resource table, but the table is a lot faster 41: # so it makes sense to maintain for now. 42: if resource.type.to_s.downcase == "class" and main = @catalog.resource(:class, :main) 43: @catalog.add_edge(main, resource) 44: else 45: @catalog.add_edge(scope.resource, resource) 46: end 47: end