 
   calls the provided function with the first filename that is
   similar to filepath, but that does not exist in the filesystem.
-  generate new filename candidates by appending an underscore "_", 
+  generate new filename candidates by appending an underscore "_",
   and the next integer.
-  ###     
+  ###
   Path.makeSafe = (filepath, callback)->
     _checkPath filepath, callback
   ###


  nicename:(name) ->
    name.toLowerCase().replace /[^a-z0-9]+/g, '-'
  
  makeTeaser:(long, options={})->
    return unless long
    
    minLength = options.minLength or 450
    maxLength = options.maxLength or 600
    
    return long if long < minLength or long < maxLength
    
    long = long.substr 0, maxLength
    
    # prefer to end the teaser at the end of a sentence (a period).
    # failing that prefer to end the teaser at the end of a word (a space).
    candidate = @tryToShorten(long, '.') or @tryToShorten long, ' ', '...'
    
    if candidate?.length > minLength
      candidate
    else
      long
  
  tryToShorten:(long, optimalBreak, suffix)->
    unless ~ long.indexOf optimalBreak then no
    else

      t = t + s.substring n - i - 1, n - i
    s = t
    s

  decimalToAnother @, 8


Function::swiss = (parent, names...)->
  for name in names
