lib/facet/string/camelize.rb in facets-1.1.0 vs lib/facet/string/camelize.rb in facets-1.2.0
- old
+ new
@@ -1,35 +2 @@
-
-class String
-
- # Variation of coverting a string to camelcase. This is unlike
- # #camelcase in that it is geared toward code reflection use.
- #
- # "this/is_a_test".camelize #=> This::IsATest
- #
- def camelize
- #to_s.gsub(/(^|_)(.)/){$2.upcase}
- to_s.gsub(/\/(.?)/){ "::" + $1.upcase }.gsub(/(^|_)(.)/){ $2.upcase }
- end
-
-end
-
-
-# _____ _
-# |_ _|__ ___| |_
-# | |/ _ \/ __| __|
-# | | __/\__ \ |_
-# |_|\___||___/\__|
-#
-=begin test
-
- require 'test/unit'
-
- class TCString < Test::Unit::TestCase
-
- def test_camelize
- assert_equal( 'ThisIsIt', 'this_is_it'.camelize )
- end
-
- end
-
-=end
+require 'facets/core/string/camelize.rb'
\ No newline at end of file