Sha256: 7149daf625adabf8895b1c91bac850160036edc1d3e32069963cf356dd910ac3
Contents?: true
Size: 344 Bytes
Versions: 6
Compression:
Stored size: 344 Bytes
Contents
# From https://github.com/rubyworks/facets/blob/master/lib/core/facets/string/modulize.rb class String def modulize #gsub('__','/'). # why was this ever here? gsub(/__(.?)/){ "::#{$1.upcase}" }. gsub(/\/(.?)/){ "::#{$1.upcase}" }. gsub(/(?:_+|-+)([a-z])/){ $1.upcase }. gsub(/(\A|\s)([a-z])/){ $1 + $2.upcase } end end
Version data entries
6 entries across 6 versions & 1 rubygems