Sha256: 91809b693a47ef3e773ef4cfc47b4c87c813aed774fbb34d5b192d7e4e29f2b6

Contents?: true

Size: 702 Bytes

Versions: 8

Compression:

Stored size: 702 Bytes

Contents

# frozen_string_literal: true

module Nanoc
  module Int
    class PrefixedDataSource < Nanoc::DataSource
      def initialize(data_source, items_prefix, layouts_prefix)
        super({}, '/', '/', {})

        @data_source = data_source
        @items_prefix = items_prefix
        @layouts_prefix = layouts_prefix
      end

      def items
        @data_source.items.map { |d| d.with_identifier_prefix(@items_prefix) }
      end

      def layouts
        @data_source.layouts.map { |d| d.with_identifier_prefix(@layouts_prefix) }
      end

      def item_changes
        @data_source.item_changes
      end

      def layout_changes
        @data_source.layout_changes
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nanoc-4.11.8 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.11.7 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.11.6 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.11.5 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.11.4 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.11.3 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.11.2 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.11.1 lib/nanoc/base/repos/prefixed_data_source.rb