Store intermediate resources in reducer so the array is not empty the first run. Addresses #1590

This commit is contained in:
Thomas Reynolds 2015-08-31 11:18:45 -07:00
parent 60d88139af
commit 5cab7c46a9

View file

@ -211,20 +211,21 @@ module Middleman
@app.logger.debug '== Rebuilding resource list' @app.logger.debug '== Rebuilding resource list'
@resources = @resource_list_manipulators.reduce([]) do |result, (_, inst)| @resources = []
newres = inst.manipulate_resource_list(result)
@resource_list_manipulators.each do |(_, inst)|
@resources = inst.manipulate_resource_list(@resources)
# Reset lookup cache # Reset lookup cache
reset_lookup_cache! reset_lookup_cache!
newres.each do |resource|
@resources.each do |resource|
@_lookup_by_path[resource.path] = resource @_lookup_by_path[resource.path] = resource
@_lookup_by_destination_path[resource.destination_path] = resource @_lookup_by_destination_path[resource.destination_path] = resource
end end
newres invalidate_resources_not_ignored_cache!
end end
invalidate_resources_not_ignored_cache!
end end
end end