lib/nanoc/base/compilation/compiler.rb in nanoc-4.0.0 vs lib/nanoc/base/compilation/compiler.rb in nanoc-4.0.1
- old
+ new
@@ -273,27 +273,28 @@
else
content_or_filename_assigns = { content: rep.snapshot_contents[:last].string }
end
# TODO: Do not expose @site (necessary for captures store though…)
- content_or_filename_assigns.merge({
+ content_or_filename_assigns.merge(
item: Nanoc::ItemView.new(rep.item),
rep: Nanoc::ItemRepView.new(rep),
item_rep: Nanoc::ItemRepView.new(rep),
items: Nanoc::ItemCollectionView.new(site.items),
layouts: Nanoc::LayoutCollectionView.new(site.layouts),
config: Nanoc::ConfigView.new(site.config),
site: Nanoc::SiteView.new(site),
- })
+ )
end
# @return [Nanoc::Int::OutdatednessChecker] The outdatedness checker
def outdatedness_checker
Nanoc::Int::OutdatednessChecker.new(
site: @site,
checksum_store: checksum_store,
- dependency_tracker: dependency_tracker)
+ dependency_tracker: dependency_tracker,
+ )
end
memoize :outdatedness_checker
private
@@ -323,11 +324,11 @@
def compile_reps(reps)
content_dependency_graph = Nanoc::Int::DirectedGraph.new(reps)
# Listen to processing start/stop
Nanoc::Int::NotificationCenter.on(:processing_started, self) { |obj| @stack.push(obj) }
- Nanoc::Int::NotificationCenter.on(:processing_ended, self) { |_obj| @stack.pop }
+ Nanoc::Int::NotificationCenter.on(:processing_ended, self) { |_obj| @stack.pop }
# Assign snapshots
reps.each do |rep|
rep.snapshot_defs = rules_collection.snapshots_defs_for(rep)
end
@@ -400,11 +401,11 @@
rescue => e
rep.forget_progress
Nanoc::Int::NotificationCenter.post(:compilation_failed, rep, e)
raise e
ensure
- Nanoc::Int::NotificationCenter.post(:visit_ended, rep.item)
+ Nanoc::Int::NotificationCenter.post(:visit_ended, rep.item)
end
# Clears the list of dependencies for items that will be recompiled.
#
# @param [Array<Nanoc::Int::Item>] items The list of items for which to forget
@@ -419,14 +420,14 @@
end
end
# Returns a preprocessor context, creating one if none exists yet.
def preprocessor_context
- Nanoc::Int::Context.new({
+ Nanoc::Int::Context.new(
config: Nanoc::MutableConfigView.new(@site.config),
items: Nanoc::MutableItemCollectionView.new(@site.items),
layouts: Nanoc::MutableLayoutCollectionView.new(@site.layouts),
- })
+ )
end
memoize :preprocessor_context
# @return [Nanoc:Int::CompiledContentCache] The compiled content cache
def compiled_content_cache