Sha256: 6884233aadd9bcc4e1c4ea1b69100ff2eae0e3c17ec857e1159418c044cb58cf

Contents?: true

Size: 719 Bytes

Versions: 5

Compression:

Stored size: 719 Bytes

Contents

module Nanoc::Int::Compiler::Stages
  class BuildReps
    def initialize(site:, action_provider:, reps:)
      @site = site
      @action_provider = action_provider
      @reps = reps
    end

    def run
      # FIXME: This also, as a side effect, generates the action sequences. :(
      # Better: let this stage return a mapping of reps onto (raw) paths *and* a mapping of objects
      # onto action sequences.

      builder = Nanoc::Int::ItemRepBuilder.new(
        @site, @action_provider, @reps
      )

      action_sequences = builder.run

      @site.layouts.each do |layout|
        action_sequences[layout] = @action_provider.action_sequence_for(layout)
      end

      action_sequences
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nanoc-4.7.9 lib/nanoc/base/services/compiler/stages/build_reps.rb
nanoc-4.7.8 lib/nanoc/base/services/compiler/stages/build_reps.rb
nanoc-4.7.7 lib/nanoc/base/services/compiler/stages/build_reps.rb
nanoc-4.7.6 lib/nanoc/base/services/compiler/stages/build_reps.rb
nanoc-4.7.5 lib/nanoc/base/services/compiler/stages/build_reps.rb