lib/awestruct/dependencies.rb in awestruct-0.5.0.cr vs lib/awestruct/dependencies.rb in awestruct-0.5.0
- old
+ new
@@ -137,10 +137,16 @@
@dependents.delete( dep )
end
def clear
@dependencies.clear
- @dependents.each{|d| d.remove_dependent( page ) }
+ @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 == ''
file = File.join( @page.site.config.dir.to_s, '.awestruct', 'dependency-cache', page.output_path )