How can I return a list of only the files, not directories, in a specified directory?
I have my_list = Dir.glob(script_path.join(\"*\"))
my_list = Dir.glob(script_path.join(\"*\"))
This re
If you want to do it in one go instead of first creating an array and then iterating over it with select, you can do something like:
select
my_list = [] Dir.foreach(dir) { |f| my_list << f if File.file?(f) }