From 75c5c162979b7cd729131e682b4ac7a299ca9067 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Sun, 23 Nov 2014 14:06:29 -0800 Subject: [PATCH] Handle path overrides --- lib/jekyll/metadata.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb index 2012afc6..68a31a05 100644 --- a/lib/jekyll/metadata.rb +++ b/lib/jekyll/metadata.rb @@ -16,8 +16,10 @@ module Jekyll # Add a path to the metadata # - # Returns true. + # Returns true, also on failure. def add(path) + return true if not File.exist? path + @metadata[path] = { "mtime" => File.mtime(path), "deps" => [] @@ -71,7 +73,8 @@ module Jekyll # # Returns nothing. 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 regenerate? dependency end