class TrelloFs::StringToFileName

Public Class Methods

convert(str) click to toggle source
# File lib/trello-fs/string_to_file_name.rb, line 3
def self.convert(str)
  str.gsub(/[^\w\s_-]+/, '').
    gsub(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2').
    gsub(/\s+/, '_')
end