# File lib/puppet/parser/type_loader.rb, line 102 102: def load_until(namespaces, name) 103: return nil if name == "" # special-case main. 104: name2files(namespaces, name).each do |filename| 105: modname = begin 106: import(filename) 107: rescue Puppet::ImportError => detail 108: # We couldn't load the item 109: # I'm not convienced we should just drop these errors, but this 110: # preserves existing behaviours. 111: nil 112: end 113: if result = yield(filename) 114: Puppet.debug "Automatically imported #{name} from #{filename} into #{environment}" 115: result.module_name = modname if modname and result.respond_to?(:module_name=) 116: return result 117: end 118: end 119: nil 120: end