lib/nanoc/helpers/capturing.rb in nanoc-4.0.0a2 vs lib/nanoc/helpers/capturing.rb in nanoc-4.0.0b1

- old
+ new

@@ -88,11 +88,11 @@ end name = args[0] # Capture and store content = capture(&block) - @site.captures_store[@item, name.to_sym] = content + @site.unwrap.captures_store[@item, name.to_sym] = content else # Get content # Get args if args.size != 2 raise ArgumentError, 'expected 2 arguments (the item ' \ "and the name of the capture) but got #{args.size} instead" @@ -100,31 +100,31 @@ item = args[0] item = item.unwrap if item.respond_to?(:unwrap) name = args[1] # Create dependency - current_item = @site.compiler.dependency_tracker.top + current_item = @site.unwrap.compiler.dependency_tracker.top if item != current_item Nanoc::Int::NotificationCenter.post(:visit_started, item) Nanoc::Int::NotificationCenter.post(:visit_ended, item) # This is an extremely ugly hack to get the compiler to recompile the # item from which we use content. For this, we need to manually edit # the content attribute to reset it. :( # FIXME: clean this up - unless @site.captures_store_compiled_items.include? item - @site.captures_store_compiled_items << item + unless @site.unwrap.captures_store_compiled_items.include? item + @site.unwrap.captures_store_compiled_items << item item.forced_outdated = true item.reps.each do |r| raw_content = item.raw_content r.content = { raw: raw_content, last: raw_content } raise Nanoc::Int::Errors::UnmetDependency.new(r) end end end # Get content - @site.captures_store[item, name.to_sym] + @site.unwrap.captures_store[item, name.to_sym] end end # Evaluates the given block and returns its contents. The contents of the # block is not outputted.