Sha256: 98eb8a7ced0889ee994f7ea65b23be7dd079dd4a40ed818b0ba584d55d5e4201
Contents?: true
Size: 1.04 KB
Versions: 35
Compression:
Stored size: 1.04 KB
Contents
module KnapsackPro module Config class TempFiles # relative to the directory where you run knapsack_pro gem (user's project) TEMP_DIRECTORY_PATH = '.knapsack_pro' def self.ensure_temp_directory_exists! unless File.exist?(gitignore_file_path) create_temp_directory! create_gitignore_file! end end private def self.create_temp_directory! FileUtils.mkdir_p(TEMP_DIRECTORY_PATH) end def self.gitignore_file_path File.join(TEMP_DIRECTORY_PATH, '.gitignore') end def self.gitignore_file_content "# This directory is used by knapsack_pro gem for storing temporary files during tests runtime.\n" << "# Ignore all files, and do not commit this directory into your repository.\n" << "# Learn more at https://knapsackpro.com\n" << "*" end def self.create_gitignore_file! File.open(gitignore_file_path, 'w+') do |f| f.write(gitignore_file_content) end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems