lib/scout/misc/format.rb in scout-gear-2.0.0 vs lib/scout/misc/format.rb in scout-gear-5.1.1

- old
+ new

@@ -99,11 +99,11 @@ return nil if string.nil? string = string.to_s if Symbol === string string. gsub(/([A-Z]{2,})([A-Z][a-z])/,'\1_\2'). gsub(/([a-z])([A-Z])/,'\1_\2'). - gsub(/\s/,'_').gsub(/[^\w_]/, ''). + gsub(/\s/,'_').gsub(/[^\w]/, ''). split("_").collect{|p| p.match(/[A-Z]{2,}/) ? p : p.downcase } * "_" end # source: https://gist.github.com/ekdevdes/2450285 # author: Ethan Kramer (https://github.com/ekdevdes) @@ -221,7 +221,6 @@ end end end values end - end