Merge pull request #4079 from jekyll/fix-jekyll-metdata-being-generated-on-non-incremental
Merge pull request 4079
This commit is contained in:
commit
48b23858ad
|
@ -130,7 +130,9 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns nothing.
|
# Returns nothing.
|
||||||
def write_metadata
|
def write_metadata
|
||||||
File.binwrite(metadata_file, Marshal.dump(metadata))
|
unless disabled?
|
||||||
|
File.binwrite(metadata_file, Marshal.dump(metadata))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Produce the absolute path of the metadata file
|
# Produce the absolute path of the metadata file
|
||||||
|
|
|
@ -39,7 +39,7 @@ class TestRegenerator < JekyllUnitTest
|
||||||
# we need to create the destinations for these files,
|
# we need to create the destinations for these files,
|
||||||
# because regenerate? checks if the destination exists
|
# because regenerate? checks if the destination exists
|
||||||
[@page, @post, @document, @asset_file].each do |item|
|
[@page, @post, @document, @asset_file].each do |item|
|
||||||
if item.respond_to?(:destination)
|
if item.respond_to?(:destination)
|
||||||
dest = item.destination(@site.dest)
|
dest = item.destination(@site.dest)
|
||||||
FileUtils.mkdir_p(File.dirname(dest))
|
FileUtils.mkdir_p(File.dirname(dest))
|
||||||
FileUtils.touch(dest)
|
FileUtils.touch(dest)
|
||||||
|
@ -67,7 +67,7 @@ class TestRegenerator < JekyllUnitTest
|
||||||
|
|
||||||
# make sure the files don't actually exist
|
# make sure the files don't actually exist
|
||||||
[@page, @post, @document, @asset_file].each do |item|
|
[@page, @post, @document, @asset_file].each do |item|
|
||||||
if item.respond_to?(:destination)
|
if item.respond_to?(:destination)
|
||||||
dest = item.destination(@site.dest)
|
dest = item.destination(@site.dest)
|
||||||
File.unlink(dest) unless !File.exist?(dest)
|
File.unlink(dest) unless !File.exist?(dest)
|
||||||
end
|
end
|
||||||
|
@ -92,7 +92,6 @@ class TestRegenerator < JekyllUnitTest
|
||||||
context "The site regenerator" do
|
context "The site regenerator" do
|
||||||
setup do
|
setup do
|
||||||
FileUtils.rm_rf(source_dir(".jekyll-metadata"))
|
FileUtils.rm_rf(source_dir(".jekyll-metadata"))
|
||||||
|
|
||||||
@site = fixture_site({
|
@site = fixture_site({
|
||||||
"incremental" => true
|
"incremental" => true
|
||||||
})
|
})
|
||||||
|
@ -306,4 +305,23 @@ class TestRegenerator < JekyllUnitTest
|
||||||
assert @regenerator.modified?(@path)
|
assert @regenerator.modified?(@path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "when incremental regen is disabled" do
|
||||||
|
setup do
|
||||||
|
FileUtils.rm_rf(source_dir(".jekyll-metadata"))
|
||||||
|
@site = Site.new(Jekyll.configuration({
|
||||||
|
"source" => source_dir,
|
||||||
|
"destination" => dest_dir,
|
||||||
|
"incremental" => false
|
||||||
|
}))
|
||||||
|
|
||||||
|
@site.process
|
||||||
|
@path = @site.in_source_dir(@site.pages.first.path)
|
||||||
|
@regenerator = @site.regenerator
|
||||||
|
end
|
||||||
|
|
||||||
|
should "not create .jekyll-metadata" do
|
||||||
|
refute File.file?(source_dir(".jekyll-metadata"))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue