Tools::FileHelper
Constants
DELETED_FILES_PATH = ".deleted_files/"
DELETED_FILES_RESOLVED_PATH = File.expand_path(DELETED_FILES_PATH)
MAX_FILESIZE = 32 * 1024
MAX_FIND_FILE_MATCHES = 1000
Instance methods
find_files(glob_pattern : String, max = MAX_FIND_FILE_MATCHES, sort = false)
Sourcefind_files(glob_pattern : String, max = MAX_FIND_FILE_MATCHES, &)
Sourceload_file_as_base64_data(resolved_path, max_file_size = MAX_FILESIZE) : String
Returns the base64-encoded content (not a data URL) of the file regardless of type; assumes path is allowed; raises errors if unable to open file.
load_file_as_data_url(resolved_path) : String
Returns the base64-encoded content of the file regardless of type; assumes path is allowed; raises errors if unable to open file.
path_in_deleted_files_folder?(path : String)
Sourceresolve_path(path)
Sourcetext_file?(resolved_path)
Sourcevalid_directory?(requested_path)
Sourcevalid_file?(resolved_path)
Sourcevalid_path?(resolved_path)
Sourcewithin_current_directory?(requested_path)
Source