Sha256: 9f41fea913630f768dfcd3f40164437c83ead45f68e7722d0abe1b91ecb70819

Contents?: true

Size: 620 Bytes

Versions: 2

Compression:

Stored size: 620 Bytes

Contents

module Bunto
  class StaticFileReader
    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 files.
    def read(files)
      files.map do |file|
        @unfiltered_content << StaticFile.new(@site, @site.source, @dir, file)
      end
      @unfiltered_content
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bunto-3.4.5 lib/bunto/readers/static_file_reader.rb
bunto-3.2.1 lib/bunto/readers/static_file_reader.rb