module

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)
Source
find_files(glob_pattern : String, max = MAX_FIND_FILE_MATCHES, &)
Source
load_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.

Source
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.

Source
path_in_deleted_files_folder?(path : String)
Source
resolve_path(path)
Source
text_file?(resolved_path)
Source
valid_directory?(requested_path)
Source
valid_file?(resolved_path)
Source
valid_path?(resolved_path)
Source
within_current_directory?(requested_path)
Source