Sha256: e4eaf8afe3df2b66b905df83028e19cb16e114e24e2bf18dfa1006052de6192b
Contents?: true
Size: 638 Bytes
Versions: 284
Compression:
Stored size: 638 Bytes
Contents
class String def col(width) self[0,width].ljust(width) end def rcol(width) #right justified self[0,width].rjust(width) end def self.shellescape(str) # An empty argument will be skipped, so return empty quotes. return "''" if str.empty? str = str.dup # Process as a single byte sequence because not all shell # implementations are multibyte aware. str.gsub!(/([^A-Za-z0-9_\-.,:\/@\n])/n, "\\\\\\1") # A LF cannot be escaped with a backslash because a backslash + LF # combo is regarded as line continuation and simply ignored. str.gsub!(/\n/, "'\n'") return str end end
Version data entries
284 entries across 284 versions & 1 rubygems