760: def self.[]=(name,object)
761: raise "Global resource storage is deprecated"
762: newobj = nil
763: if object.is_a?(Puppet::Type)
764: newobj = object
765: else
766: raise Puppet::DevError, "must pass a Puppet::Type object"
767: end
768:
769: if exobj = @objects[name] and self.isomorphic?
770: msg = "Object '#{newobj.class.name}[#{name}]' already exists"
771:
772: msg += ("in file #{object.file} at line #{object.line}") if exobj.file and exobj.line
773: msg += ("and cannot be redefined in file #{object.file} at line #{object.line}") if object.file and object.line
774: error = Puppet::Error.new(msg)
775: raise error
776: else
777:
778:
779: @objects[name] = newobj
780: end
781: end