Sha256: 4fceeebe70a0c62031c60abb72371552fb93e9c658287776f79febf995cd59a6
Contents?: true
Size: 653 Bytes
Versions: 17
Compression:
Stored size: 653 Bytes
Contents
module TemporaryDirectory def self.included(mod) mod.before{init_temporary_directory} mod.after{remove_temporary_directory} end def temporary_directory "#{ROOT}/spec/tmp" end private # --------------------------------------------------------- def init_temporary_directory remove_temporary_directory FileUtils.mkdir_p(temporary_directory) # When an attachment is deleted, it deletes empty ancestral # directories. Don't delete past the temporary directory. FileUtils.touch "#{temporary_directory}/.do_not_delete" end def remove_temporary_directory FileUtils.rm_rf(temporary_directory) end end
Version data entries
17 entries across 17 versions & 1 rubygems