Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/evil-winrm.rb

Overview

Class to create array (tokenize) from a string

Instance Method Summary collapse

Instance Method Details

#tokenizeObject



616
617
618
619
620
621
# File 'lib/evil-winrm.rb', line 616

def tokenize
self.
    split(/\s(?=(?:[^'"]|'[^']*'|"[^"]*")*$)/).
    select {|s| not s.empty? }.
    map {|s| s.gsub(/(^ +)|( +$)|(^["']+)|(["']+$)/,'')}
end