# File lib/chef-config/path_helper.rb, line 304 def self.split_args(line) cmd_args = [] field = "" line.scan(/\s*(?>([^\s\\"]+|"([^"]*)"|'([^']*)')|(\S))(\s|\z)?/m) do |word, within_dq, within_sq, esc, sep| # Append the string with Word & Escape Character field << (word || esc.gsub(/\\(.)/, '\\1')) # Re-build the field when any whitespace character or # End of string is encountered if sep cmd_args << field field = "" end end cmd_args end