lib/core/facets/string/snakecase.rb in facets-2.4.5 vs lib/core/facets/string/snakecase.rb in facets-2.5.0
- old
+ new
@@ -6,10 +6,10 @@
#
# Examples
# "SnakeCase".snakecase #=> "snake_case"
# "Snake-Case".snakecase #=> "snake_case"
# "SnakeCase::Errors".underscore #=> "snake_case/errors"
-
+ #
def snakecase
gsub(/::/, '/'). # NOT SO SURE ABOUT THIS -T
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").