module Helper::Upload
Module for keeping upload settings
Public Class Methods
default_options()
click to toggle source
Default options for the upload module
# File lib/skynet/helper.rb 36 def self.default_options 37 { 38 portal_url: Helper::PORTAL_URL, 39 portal_upload_path: 'skynet/skyfile', 40 portal_file_fieldname: 'file', 41 portal_directory_fieldname: 'files[]', 42 custom_filename: nil 43 } 44 end
strip_dotslash_path(file_path)
click to toggle source
Removes “./” from a given filename if provided
# File lib/skynet/helper.rb 47 def self.strip_dotslash_path(file_path) 48 return nil if file_path.nil? 49 50 if file_path.start_with?('./') 51 return file_path.delete_prefix('./') 52 else 53 return file_path 54 end 55 end