我正在尝试对 Ruby 脚本进行一些小改动,以便可以在运行时指定文件夹位置。
我很确定这将是一件容易的事,即使我不是 Ruby 程序员,但我找不到正确的语法。
puts "Enter folder name and press enter: "
folder = gets
files = Dir.glob("folder/[0-100]*.txt"); # What is the correct syntax to use, so the content of the variable folder will be used?
puts files