Check if a dir is empty but ignore hidden files

 Dir.glob("foo/*").empty?

If you want get hidden file list

Dir.glob("foo/.*, match_hidden: true)
2 Likes