Sha256: 4a838d79fc439702b2c0ec9f0e75a01531212897d9095c10008e9c2665d746a3
Contents?: true
Size: 1.07 KB
Versions: 6
Compression:
Stored size: 1.07 KB
Contents
module Nanoc module Int class RecordingExecutor attr_reader :rule_memory def initialize @rule_memory = [] end def filter(_rep, filter_name, filter_args = {}) @rule_memory << [:filter, filter_name, filter_args] end def layout(_rep, layout_identifier, extra_filter_args = nil) if extra_filter_args @rule_memory << [:layout, layout_identifier, extra_filter_args] else @rule_memory << [:layout, layout_identifier] end end def snapshot(_rep, snapshot_name, params = {}) @rule_memory << [:snapshot, snapshot_name, params] # Count existing = Set.new names = @rule_memory.select { |r| r[0] == :snapshot }.map { |r| r[1] } names.each do |n| if existing.include?(n) raise Nanoc::Int::Errors::CannotCreateMultipleSnapshotsWithSameName.new(@item_rep, snapshot_name) end existing << n end end def record_write(_rep, path) @rule_memory << [:write, path] end end end end
Version data entries
6 entries across 6 versions & 1 rubygems