jekyll 3.0.0.pre.beta10 → 3.0.0.pre.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of jekyll might be problematic. Click here for more details.

@@ -1,37 +0,0 @@
1
- module Jekyll
2
- class DraftReader
3
- attr_reader :site, :unfiltered_content
4
- def initialize(site)
5
- @site = site
6
- @unfiltered_content = Array.new
7
- end
8
-
9
- # Read all the files in <source>/<dir>/_drafts and create a new Draft
10
- # object with each one.
11
- #
12
- # dir - The String relative path of the directory to read.
13
- #
14
- # Returns nothing.
15
- def read(dir)
16
- @unfiltered_content = read_content(dir, '_drafts')
17
- @unfiltered_content.select{ |draft| site.publisher.publish?(draft) }
18
- end
19
-
20
- # Read all the content files from <source>/<dir>/magic_dir
21
- # and return them with the type klass.
22
- #
23
- # dir - The String relative path of the directory to read.
24
- # magic_dir - The String relative directory to <dir>,
25
- # looks for content here.
26
- # klass - The return type of the content.
27
- #
28
- # Returns klass type of content files
29
- def read_content(dir, magic_dir)
30
- @site.reader.get_entries(dir, magic_dir).map do |entry|
31
- Draft.new(site, site.source, dir, entry) if Draft.valid?(entry)
32
- end.reject do |entry|
33
- entry.nil?
34
- end
35
- end
36
- end
37
- end