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


895
896
897
898
899
900
# File 'lib/evil-winrm.rb', line 895

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