Check location before using them
This commit is contained in:
@@ -26,6 +26,10 @@ class CacheFileStore
|
|||||||
unless Dir.exist?(@storage_path)
|
unless Dir.exist?(@storage_path)
|
||||||
FileUtils.mkdir_p(@storage_path)
|
FileUtils.mkdir_p(@storage_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unless Pathname.new(@storage_path).writable?
|
||||||
|
fail "#{@storage_path} is not writable"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def clean
|
def clean
|
||||||
|
|||||||
@@ -13,8 +13,13 @@ class DbUpdater
|
|||||||
def initialize(repo_directory)
|
def initialize(repo_directory)
|
||||||
@repo_directory = repo_directory
|
@repo_directory = repo_directory
|
||||||
|
|
||||||
fail "#{repo_directory} is not writable" unless \
|
unless Dir.exist?(@repo_directory)
|
||||||
Pathname.new(repo_directory).writable?
|
FileUtils.mkdir_p(@repo_directory)
|
||||||
|
end
|
||||||
|
|
||||||
|
unless Pathname.new(@repo_directory).writable?
|
||||||
|
fail "#{@repo_directory} is not writable"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [ Hash ] The params for Typhoeus::Request
|
# @return [ Hash ] The params for Typhoeus::Request
|
||||||
|
|||||||
Reference in New Issue
Block a user