Sha256: a7803b564c210d3dc59888de28d282cbfeb934c289656ec8ff59eedc1fcc1bbc
Contents?: true
Size: 353 Bytes
Versions: 4
Compression:
Stored size: 353 Bytes
Contents
class ::String def squish self.force_encoding("UTF-8").gsub(/\s+/, " ").strip end def antiinject udquote = '"'.force_encoding("UTF-8").unpack('U*').map{ |i| "\\u" + i.to_s(16).rjust(4, '0') }.join self.force_encoding("UTF-8").gsub(/"/, udquote) end def quotenormalize self.force_encoding("UTF-8").gsub(/\\u0022/, '"') end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
rubygoods-0.0.0.8 | lib/rubygoods/string.rb |
rubygoods-0.0.0.7 | lib/rubygoods/string.rb |
rubygoods-0.0.0.6 | lib/rubygoods/string.rb |
rubygoods-0.0.0.5 | lib/rubygoods/string.rb |