lib/webgen/sourcehandler.rb in gettalong-webgen-0.5.7.20090227 vs lib/webgen/sourcehandler.rb in gettalong-webgen-0.5.8.20090507
- old
+ new
@@ -60,11 +60,11 @@
puts "Writing changed nodes..."
time = Benchmark.measure do
write_tree(tree)
end
puts "...done in " + ('%2.4f' % time.real) + ' seconds'
- end while tree.node_access[:alcn].any? {|name,node| node.flagged(:created) || node.flagged(:reinit)}
+ end while tree.node_access[:alcn].any? {|name,node| node.flagged?(:created) || node.flagged?(:reinit)}
:success
end
#######
private
@@ -84,11 +84,11 @@
deleted = !find_all_source_paths.include?(node.node_info[:src])
if deleted
nodes_to_delete << node
#TODO: delete output path
- elsif (!node.flagged(:created) && find_all_source_paths[node.node_info[:src]].changed?) || node.meta_info_changed?
+ elsif (!node.flagged?(:created) && find_all_source_paths[node.node_info[:src]].changed?) || node.meta_info_changed?
node.flag(:reinit)
paths_to_use << node.node_info[:src]
elsif node.changed?
# nothing to be done here
end
@@ -96,20 +96,20 @@
nodes_to_delete.each {|node| tree.delete_node(node)}
used_paths.merge(paths_to_use)
paths = create_nodes_from_paths(tree, used_paths.to_a.sort)
unused_paths.merge(used_paths - paths)
- tree.node_access[:alcn].each {|name, node| tree.delete_node(node) if node.flagged(:reinit)}
+ tree.node_access[:alcn].each {|name, node| tree.delete_node(node) if node.flagged?(:reinit)}
website.cache.reset_volatile_cache
end until used_paths.empty?
end
# Write out all changed nodes of the +tree+.
def write_tree(tree)
output = website.blackboard.invoke(:output_instance)
tree.node_access[:alcn].select do |name, node|
- use_node = (node != tree.dummy_root && node.flagged(:dirty))
+ use_node = (node != tree.dummy_root && node.flagged?(:dirty))
node.unflag(:dirty_meta_info)
node.unflag(:created)
node.unflag(:dirty)
use_node
end.sort.each do |name, node|