Sha256: fb59c11da66bf047f8be9f3b1806499bf3d0a3e493259eedaf2088b5fb0690d4

Contents?: true

Size: 643 Bytes

Versions: 6

Compression:

Stored size: 643 Bytes

Contents

module Nanoc::Int
  # @api private
  class ItemRepBuilder
    attr_reader :reps

    def initialize(site, action_provider, reps)
      @site = site
      @action_provider = action_provider
      @reps = reps
    end

    def run
      @site.items.each do |item|
        @action_provider.rep_names_for(item).each do |rep_name|
          @reps << Nanoc::Int::ItemRep.new(item, rep_name)
        end
      end

      action_sequences = Nanoc::Int::ItemRepRouter.new(@reps, @action_provider, @site).run

      @reps.each do |rep|
        rep.snapshot_defs = action_sequences[rep].snapshots_defs
      end

      action_sequences
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nanoc-4.7.9 lib/nanoc/base/services/item_rep_builder.rb
nanoc-4.7.8 lib/nanoc/base/services/item_rep_builder.rb
nanoc-4.7.7 lib/nanoc/base/services/item_rep_builder.rb
nanoc-4.7.6 lib/nanoc/base/services/item_rep_builder.rb
nanoc-4.7.5 lib/nanoc/base/services/item_rep_builder.rb
nanoc-4.7.4 lib/nanoc/base/services/item_rep_builder.rb