Sha256: 33ff54c956a40808cfd2e928dd59aa3cd61aab9bfd4cd9f1b461c948dd272db6

Contents?: true

Size: 637 Bytes

Versions: 3

Compression:

Stored size: 637 Bytes

Contents

module Bunto
  class PageReader
    attr_reader :site, :dir, :unfiltered_content
    def initialize(site, dir)
      @site = site
      @dir = dir
      @unfiltered_content = []
    end

    # Read all the files in <source>/<dir>/ for Yaml header and create a new Page
    # object for each file.
    #
    # dir - The String relative path of the directory to read.
    #
    # Returns an array of static pages.
    def read(files)
      files.map { |page| @unfiltered_content << Page.new(@site, @site.source, @dir, page) }
      @unfiltered_content.select { |page| site.publisher.publish?(page) }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bunto-3.0.0 lib/bunto/readers/page_reader.rb
bunto-2.0.0.pre lib/bunto/readers/page_reader.rb
bunto-1.0.0 lib/bunto/readers/page_reader.rb