Sha256: 69f94c2487e2af52dee960ea89d6dbd4b760df217529767d8738be7fee8042a8
Contents?: true
Size: 835 Bytes
Versions: 14
Compression:
Stored size: 835 Bytes
Contents
module Corneal module Extensions module String def camel_case return self.gsub(/^./) { |l| l.capitalize } if !match(/[_-]/) altered_self = self.downcase.capitalize altered_self.scan(/[_-][a-zA-Z]/).each do |match| altered_self.gsub!(match, match[1].upcase) end altered_self end def camel_case! self.replace camel_case end def directory_name self.downcase.gsub(/[^a-z|\-|\_]/, '') end def file_name self.gsub(/[\-| ]/, '_'). gsub(/([A-Z]+|[A-Z][a-z])/) { |x| "_#{x}" }. sub(/^_/, ""). gsub(/_{2,}+/, "_"). downcase end def file_name! self.replace file_name end end end end String.send(:include, Corneal::Extensions::String)
Version data entries
14 entries across 14 versions & 2 rubygems