I want to make a command-line utility in ruby that when run, list the files in the current directory and shows it as an option list.
1 - somefile.txt
2 - somefile.pdf
3- somefile.whatever
So i can input let’s say option 2 and somefile.pdf gets selected to do whatever i want to do.
Any directions would be much appreciated.
http://ruby-doc.org/core-1.9.3/Dir.html#method-c-glob
Dir.glob will list all files in directory as array, all other steps are obvious.