Sha256: 3d5261b3a95ee4b7c601bcb301cd28bfb5e89e44ca38deb982067855c865bf9e
Contents?: true
Size: 647 Bytes
Versions: 34
Compression:
Stored size: 647 Bytes
Contents
# frozen_string_literal: true module Nanoc::RuleDSL class CompilationRule < Rule include Nanoc::Core::ContractsSupport contract Nanoc::Core::ItemRep, C::KeywordArgs[ site: Nanoc::Core::Site, recorder: Nanoc::RuleDSL::ActionRecorder, view_context: Nanoc::Core::ViewContextForPreCompilation, ] => C::Any def apply_to(rep, site:, recorder:, view_context:) context = Nanoc::RuleDSL::CompilationRuleContext.new( rep: rep, recorder: recorder, site: site, view_context: view_context, ) context.instance_exec(matches(rep.item.identifier), &@block) end end end
Version data entries
34 entries across 34 versions & 1 rubygems