class PathExpander

def expand_dirs_to_files *dirs

def expand_dirs_to_files *dirs
  dirs.flatten.map { |p|
    if File.directory? p then
      Dir[File.join(p, glob)].find_all { |f| File.file? f }
    else
      p
    end
  }.flatten.sort.map { |s| s.to_s.delete_prefix "./" }
end