From 5e38d68adbc44968583a38bbd86dd4f14371055f Mon Sep 17 00:00:00 2001 From: erwanlr Date: Sat, 9 Nov 2013 11:26:49 +0000 Subject: [PATCH] Properly create the cache directory (Kali issue) --- .gitignore | 2 +- cache/.gitignore | 4 ---- lib/common/cache_file_store.rb | 2 +- lib/environment.rb | 1 + 4 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 cache/.gitignore diff --git a/.gitignore b/.gitignore index 67f6f665..59013f4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -cache/* +cache coverage .bundle .DS_Store diff --git a/cache/.gitignore b/cache/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/cache/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/lib/common/cache_file_store.rb b/lib/common/cache_file_store.rb index a9df5d5b..6f7cf2ec 100644 --- a/lib/common/cache_file_store.rb +++ b/lib/common/cache_file_store.rb @@ -24,7 +24,7 @@ class CacheFileStore # File.directory? for ruby <= 1.9 otherwise, # it makes more sense to do Dir.exist? :/ unless File.directory?(@storage_path) - Dir.mkdir(@storage_path) + FileUtils.mkdir_p(@storage_path) end end diff --git a/lib/environment.rb b/lib/environment.rb index 479bbfd7..ac7b8c0b 100644 --- a/lib/environment.rb +++ b/lib/environment.rb @@ -27,6 +27,7 @@ begin require 'rbconfig' require 'pp' require 'shellwords' + require 'fileutils' # Third party libs require 'typhoeus' require 'json'