replace Dir.mkdir with FileUtils.mkdir_p for recursive creation of nonexistent directories

This commit is contained in:
Clarence "Sparr" Risher
2017-03-10 20:22:14 -05:00
committed by Andy Meneely
parent 2ab78dd8d4
commit 599e363e38
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ module Squib
def ensure_dir_created(dir)
unless Dir.exists?(dir)
Squib.logger.warn "Dir '#{dir}' does not exist, creating it."
Dir.mkdir dir
FileUtils.mkdir_p dir
end
return dir
end
+1 -1
View File
@@ -34,7 +34,7 @@ module Squib
when :memory
Cairo::ImageSurface.new(@width, @height)
when :svg
Dir.mkdir @deck.dir unless Dir.exists?(@deck.dir)
FileUtils.mkdir_p @deck.dir unless Dir.exists?(@deck.dir)
Cairo::SVGSurface.new(svgfile, @width, @height)
else
Squib.logger.fatal "Back end not recognized: '#{backend}'"