Method: AppInfo::Util.tempdir

Defined in:
lib/app_info/util.rb

.tempdir(file, prefix:) ⇒ Object



89
90
91
92
93
94
95
96
# File 'lib/app_info/util.rb', line 89

def self.tempdir(file, prefix:)
  dest_path ||= File.join(File.dirname(file), prefix)
  dest_file = File.join(dest_path, File.basename(file))

  Dir.mkdir(dest_path, 0_700) unless Dir.exist?(dest_path)

  dest_file
end