"» require ‘shellwords’
=> true
» Shellwords::shellwords(‘foo “bar baz” qux’)
=> [“foo”, “bar baz”, “qux”]"

Mike Naberezny - Parsing Quoted Strings in Ruby