Sha256: 1ab162be7874c133cc4bdff4fe2b2ab0f04df64525f891f7d154f9de3f591e3a
Contents?: true
Size: 478 Bytes
Versions: 14
Compression:
Stored size: 478 Bytes
Contents
module Simplabs module Excellent module Extensions #:nodoc: ::String.class_eval do def underscore to_s.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end def lpad(to, with = ' ') return self if self.length >= to "#{with * (to - self.length)}#{self}" end end end end end
Version data entries
14 entries across 14 versions & 2 rubygems