lib/webgen/path_handler/page_utils.rb in webgen-1.0.0.beta2 vs lib/webgen/path_handler/page_utils.rb in webgen-1.0.0.beta3

- old
+ new

@@ -33,11 +33,11 @@ unless blocks.has_key?(name) raise Webgen::RenderError.new("No block named '#{name}' found", nil, context.dest_node.alcn, alcn) end content_processor = context.website.ext.content_processor - context.website.ext.item_tracker.add(context.dest_node, :node_content, alcn) + context.website.ext.item_tracker.add(context.dest_node, :node_content, self) context.content = blocks[name].dup context[:block_name] = name pipeline ||= ((self['blocks'] || {})[name] || {})['pipeline'] || ((self['blocks'] || {})['defaults'] || {})['pipeline'] || @@ -121,11 +121,12 @@ protected :default_template end - def create_node(path, node_klass = Node) #:nodoc: + def create_node(path) #:nodoc: + path['node_class'] ||= Node.to_s super end # Calls #parse_as_page! to update the meta information hash of +path+. Returns the found # blocks which will be passed as second parameter to the #create_nodes method. @@ -137,10 +138,10 @@ # 'path.meta_info' with the meta info from the page and returns the content blocks. def parse_as_page!(path) begin page = Webgen::Page.from_data(path.data) rescue Webgen::Page::FormatError => e - raise Webgen::Error.new("Error reading source path: #{e.message}", self.class.name, path) + raise Webgen::Error.new("Error reading source path: #{e.message}", nil, path) end blocks = page.meta_info.delete('blocks') || {} path.meta_info.merge!(page.meta_info) blocks.each {|key, val| ((path.meta_info['blocks'] ||= {})[key] ||= {}).merge!(val)} page.blocks