Handle path overrides

This commit is contained in:
Alfred Xing 2014-11-23 14:06:29 -08:00
parent 4acf343fea
commit 75c5c16297
1 changed files with 5 additions and 2 deletions

View File

@ -16,8 +16,10 @@ module Jekyll
# Add a path to the metadata # Add a path to the metadata
# #
# Returns true. # Returns true, also on failure.
def add(path) def add(path)
return true if not File.exist? path
@metadata[path] = { @metadata[path] = {
"mtime" => File.mtime(path), "mtime" => File.mtime(path),
"deps" => [] "deps" => []
@ -71,7 +73,8 @@ module Jekyll
# #
# Returns nothing. # Returns nothing.
def add_dependency(path, dependency) def add_dependency(path, dependency)
add(path) if @metadata[path].nil? return if @metadata[path].nil?
@metadata[path]["deps"] << dependency unless @metadata[path]["deps"].include? dependency @metadata[path]["deps"] << dependency unless @metadata[path]["deps"].include? dependency
regenerate? dependency regenerate? dependency
end end