module MovieMasher::FileHelper

makes directories and sets permissions based on config

Public Class Methods

safe_path(path, mod = nil) click to toggle source
# File lib/util/file_helper.rb, line 5
def self.safe_path(path, mod = nil)
  options = {}
  mod = MovieMasher.configuration[:chmod_directory_new] if mod.nil?
  if mod
    mod = mod.to_i(8) if mod.is_a?(String)
    options[:mode] = mod
  end
  FileUtils.makedirs(path, options)
end