module CustomFileUtils

Public Instance Methods

create_empty_file(full_file_path) click to toggle source
# File lib/utils/custom_files_utils.rb, line 2
def create_empty_file(full_file_path)
    dir = File.dirname(full_file_path)

    FileUtils.mkdir_p(dir) unless File.directory?(dir)
    
    File.new(full_file_path, 'w').close()
end
write_file(path_to_file, file_content) click to toggle source
# File lib/utils/custom_files_utils.rb, line 10
def write_file(path_to_file, file_content)
    create_empty_file path_to_file 
            open(path_to_file, 'w') do |f|                  
        f.puts file_content
    end
end