Daniel Harple
3/26/2006 4:14:00 PM
On Mar 26, 2006, at 6:03 PM, lubomir.markovic@gmail.com wrote:
> Hello,
>
> I can't find a function that takes a string as an input, parses it and
> returns an array in the exactly same way as command line is parsed
> into
> ARGV array variable.
> Could you give me a hint?
>
> Thanks in advance
> Lubos
require 'shellwords'
args = Shellwords.shellwords('foo\ bar "another shellword"') # =>
["foo bar", "another shellword"]
-- Daniel