From 16bee7618c328ecd790db366221639661912c477 Mon Sep 17 00:00:00 2001 From: Norman Clarke Date: Thu, 5 Jan 2012 17:25:40 -0300 Subject: [PATCH] Use friendlier method name --- activesupport/lib/active_support/multibyte/chars.rb | 4 ++-- activesupport/test/multibyte_chars_test.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index eb7f99dd71..99b974e4a7 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -168,8 +168,8 @@ module ActiveSupport #:nodoc: # # Example: # 'क्षि'.mb_chars.length # => 4 - # 'क्षि'.mb_chars.g_length # => 3 - def g_length + # 'क्षि'.mb_chars.grapheme_length # => 3 + def grapheme_length Unicode.unpack_graphemes(@wrapped_string).length end diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb index 87830d57d3..e36bd22081 100644 --- a/activesupport/test/multibyte_chars_test.rb +++ b/activesupport/test/multibyte_chars_test.rb @@ -595,7 +595,7 @@ class MultibyteCharsExtrasTest < Test::Unit::TestCase else str = input end - assert_equal expected_length, chars(str).g_length + assert_equal expected_length, chars(str).grapheme_length end end