Sha256: 6c696ab309df3e17f79adbf9d4ae408bbcb330842dedc47008b24389efc46745

Contents?: true

Size: 520 Bytes

Versions: 16

Compression:

Stored size: 520 Bytes

Contents

# frozen_string_literal: true

module Nanoc::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
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
nanoc-4.8.10 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.8.9 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.8.8 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.8.7 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.8.6 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.8.5 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.8.4 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.8.3 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.8.2 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.8.1 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.8.0 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.7.14 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.7.13 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.7.12 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.7.11 lib/nanoc/base/repos/prefixed_data_source.rb
nanoc-4.7.10 lib/nanoc/base/repos/prefixed_data_source.rb