Sha256: 132457dd621b4a0f7d20b603f44245532eafe2e5817f8fba95a7e2b898bf8b31
Contents?: true
Size: 638 Bytes
Versions: 17
Compression:
Stored size: 638 Bytes
Contents
# frozen_string_literal: true module Nanoc::RuleDSL class CompilationRule < Rule include Nanoc::Int::ContractsSupport contract Nanoc::Int::ItemRep, C::KeywordArgs[ site: Nanoc::Int::Site, recorder: Nanoc::RuleDSL::ActionRecorder, view_context: Nanoc::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
17 entries across 17 versions & 1 rubygems