I want to get all file names from a folder using Ruby.
In an IRB context, you can use the following to get the files in the current directory:
file_names = `ls`.split("\n")
You can make this work on other directories too:
file_names = `ls ~/Documents`.split("\n")