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

Version Path
nanoc-4.12.21 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.20 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.19 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.18 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.17 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.16 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.15 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.14 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.13 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.12 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.11 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.10 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.9 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.8 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.7 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.6 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.5 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.4 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.3 lib/nanoc/rule_dsl/compilation_rule.rb
nanoc-4.12.2 lib/nanoc/rule_dsl/compilation_rule.rb