Sha256: f5f2f2e956a815e04a683884eee010052e12129ae8d85a5cfdc935cc022bfb56
Contents?: true
Size: 398 Bytes
Versions: 45
Compression:
Stored size: 398 Bytes
Contents
module Enumerable def dups inject({}) {|h,v| h[v]=h[v].to_i+1; h}.reject{|k,v| v==1}.keys end end class String # copy from rails def underscore self.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end end class NilClass def method_missing(method_sym, *arguments, &block) return nil end end
Version data entries
45 entries across 45 versions & 1 rubygems