From e63b4c932f31c940c331c2aaf84ef7e7b9e475ad Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 19 Sep 2013 09:43:00 -0400 Subject: [PATCH] Cache: create missing hash entries from previous versions of the cache file --- lib/rscons/cache.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/rscons/cache.rb b/lib/rscons/cache.rb index ee133e5..dc94a7f 100644 --- a/lib/rscons/cache.rb +++ b/lib/rscons/cache.rb @@ -60,11 +60,10 @@ module Rscons # Create a Cache object and load in the previous contents from the cache # file. def initialize - @cache = YAML.load(File.read(CACHE_FILE)) rescue { - targets: {}, - directories: {}, - version: VERSION, - } + @cache = YAML.load(File.read(CACHE_FILE)) rescue {} + @cache[:targets] ||= {} + @cache[:directories] ||= {} + @cache[:version] ||= VERSION @lookup_checksums = {} end