lib/awestruct/dependencies.rb in awestruct-0.5.4.rc3 vs lib/awestruct/dependencies.rb in awestruct-0.5.4

- old
+ new

@@ -1,6 +1,5 @@ - module Awestruct class Dependencies attr_reader :page attr_reader :dependencies @@ -46,11 +45,11 @@ end end def self.track_dependency(dep) - return if top_page.nil? + return if top_page.nil? return if top_page == dep $LOG.debug "dep #{top_page.relative_source_path} - #{dep.relative_source_path}" if $LOG.debug? top_page.dependencies.add_dependency(dep) end @@ -137,16 +136,16 @@ @dependents.delete( dep ) end def clear @dependencies.clear - @dependents.each do |d| - if (d.instance_of? Awestruct::Dependencies) - d.remove_dependent( page ) - else - d.dependencies.remove_dependent( page ) - end + @dependents.each do |d| + if (d.instance_of? Awestruct::Dependencies) + d.remove_dependent( page ) + else + d.dependencies.remove_dependent( page ) + end end end def persist! return if page.output_path.nil? || page.output_path == '' @@ -193,9 +192,8 @@ end def find_page_by_path(path) page.site.pages_by_relative_source_path[ path ] end - end end