Often you need to get files listing from some directory in your administrative tasks/scripts. It's really simple to list directories within Ruby code. I prefer to use Dir class. You can use it as shown below:
files = Dir.glob("*")
Returns all files from the current directory as an Array. You can iterate over every element very easy and use it for custom action.
That's all for today. Thanks