lib/cloud_crowd/action.rb
# Convert an unsafe URL into a filesystem-friendly filename.
Convert an unsafe URL into a filesystem-friendly filename.
Convert an unsafe URL into a filesystem - friendly filename .
def safe_filename(url)
      ext  = File.extname(url)
      name = URI.unescape(File.basename(url)).gsub(/[^a-zA-Z0-9_\-.]/, '-').gsub(/-+/, '-')
      File.basename(name, ext).gsub('.', '-') + ext
    end
def safe_filename ( url ) ext = File . extname ( url ) name = URI . unescape ( File . basename ( url ) ) . gsub ( / [^a-zA-Z0-9_ \- .] / , '-' ) . gsub ( / -+ / , '-' ) File . basename ( name , ext ) . gsub ( '.' , '-' ) + ext end
Convert an unsafe URL into a filesystem-friendly filename.
Convert an unsafe URL into a filesystem - friendly filename .
url
<not_specific>