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



957
958
959
960
961
962
# File 'lib/evil-winrm.rb', line 957

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