Minor perf tweaks

This commit is contained in:
Thomas Reynolds 2016-04-21 16:06:26 -07:00
parent a14934e08b
commit 0f2bc1e0ea
19 changed files with 130 additions and 68 deletions

View file

@ -298,9 +298,15 @@ module Middleman
relative_path = path.relative_path_from(directory)
relative_path = File.join(destination_dir, relative_path) if destination_dir
types << :no_frontmatter if partial?(relative_path.to_s)
::Middleman::SourceFile.new(Pathname(relative_path), path, directory, types, 0)
end
def partial?(relative_path)
relative_path.split(::File::SEPARATOR).any? { |p| p.start_with?('_') }
end
Contract IsA['Middleman::SourceFile'] => Any
def record_file_change(f)
if @files[f[:full_path]]