Sha256: ed5cb2e093064b90bfe0361606f0937a847a063e273a444df9929b99a7f0a844

Contents?: true

Size: 579 Bytes

Versions: 3

Compression:

Stored size: 579 Bytes

Contents

# frozen_string_literal: true

module Nanoc
  module Int
    class InMemDataSource < Nanoc::DataSource
      attr_reader :items
      attr_reader :layouts

      def initialize(items, layouts, orig_data_source = nil)
        super({}, '/', '/', {})

        @items = items
        @layouts = layouts
        @orig_data_source = orig_data_source
      end

      def item_changes
        @orig_data_source ? @orig_data_source.item_changes : super
      end

      def layout_changes
        @orig_data_source ? @orig_data_source.layout_changes : super
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nanoc-4.11.3 lib/nanoc/base/repos/in_mem_data_source.rb
nanoc-4.11.2 lib/nanoc/base/repos/in_mem_data_source.rb
nanoc-4.11.1 lib/nanoc/base/repos/in_mem_data_source.rb