module Sprockets::PathUtils

def entries(path)

Returns an empty `Array` if the directory does not exist.

path - String directory path

swap files.
Public: A version of `Dir.entries` that filters out `.` files and `~`
def entries(path)
  if File.directory?(path)
    Dir.entries(path, :encoding => Encoding.default_internal).reject! { |entry|
      entry =~ /^\.|~$|^\#.*\#$/
    }.sort!
  else
    []
  end
end