method

shellsplit

v1_8_7_72 - Show latest stable - Class: Shellwords
shellsplit(line)
public

Splits a string into an array of tokens in the same way the UNIX Bourne shell does.

  argv = Shellwords.split('here are "two words"')
  argv #=> ["here", "are", "two words"]

+String#shellsplit+ is a shorthand for this function.

  argv = 'here are "two words"'.shellsplit
  argv #=> ["here", "are", "two words"]