Class: FileNames

Inherits:
Object
  • Object
show all
Defined in:
lib/helpers/filesystem_helpers.rb

Instance Method Summary collapse

Instance Method Details

#flatten_problem_chars(filenames) ⇒ Object



23
24
25
26
# File 'lib/helpers/filesystem_helpers.rb', line 23

def flatten_problem_chars(filenames)
  #via http://stackoverflow.com/questions/2270635/invalid-chars-filter-for-file-folder-name-ruby
  file_names.map! { |f| f.gsub(/[\x00\/\\:\*\?\"<>\|]/, '_') }
end