Extracted each method
This commit is contained in:
parent
b5d4a96149
commit
13fd798ec0
|
@ -240,9 +240,7 @@ module Jekyll
|
||||||
|
|
||||||
# files to be written
|
# files to be written
|
||||||
files = Set.new
|
files = Set.new
|
||||||
[self.posts, self.pages, self.static_files].flatten.each do |item|
|
site_files_each { |item| files << item.destination(self.dest) }
|
||||||
files << item.destination(self.dest)
|
|
||||||
end
|
|
||||||
|
|
||||||
# adding files' parent directories
|
# adding files' parent directories
|
||||||
dirs = Set.new
|
dirs = Set.new
|
||||||
|
@ -269,9 +267,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns nothing.
|
# Returns nothing.
|
||||||
def write
|
def write
|
||||||
[self.posts, self.pages, self.static_files].flatten.each do |item|
|
site_files_each { |item| item.write(self.dest) }
|
||||||
item.write(self.dest)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Construct a Hash of Posts indexed by the specified Post attribute.
|
# Construct a Hash of Posts indexed by the specified Post attribute.
|
||||||
|
@ -404,6 +400,14 @@ module Jekyll
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def site_files_each
|
||||||
|
%w(posts pages static_files).each do |type|
|
||||||
|
self.send(type).each do |item|
|
||||||
|
yield item
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def has_yaml_header?(file)
|
def has_yaml_header?(file)
|
||||||
|
|
Loading…
Reference in New Issue