image by Tom Schaub
詳しい話はid:tuto0621さんのブログに譲るとして、10秒で何ができるかを説明する。
こんな感じで使える。
require 'shellwords' system("ls #{Shellwords.escape(ARGV[0])}")
こんな仕組み。
irb(main):013:0> Shellwords.escape("foo bar.txt") => "foo\\ bar.txt" irb(main):014:0> Shellwords.escape("a+b+c bar.txt") => "a\\+b\\+c\\ bar.txt"
便利。