From 7dd80d68e509134cb0f821142b6b3ec46262a5a4 Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Mon, 28 May 2012 23:32:04 +0300 Subject: remove unnecessary require AS::Multibyte are no longer required by access and filters string core extensions. --- activesupport/lib/active_support/core_ext/string/access.rb | 2 -- activesupport/lib/active_support/core_ext/string/filters.rb | 2 -- 2 files changed, 4 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/string/access.rb b/activesupport/lib/active_support/core_ext/string/access.rb index 5c32a2453d..8fa8157d65 100644 --- a/activesupport/lib/active_support/core_ext/string/access.rb +++ b/activesupport/lib/active_support/core_ext/string/access.rb @@ -1,5 +1,3 @@ -require 'active_support/multibyte' - class String # If you pass a single Fixnum, returns a substring of one character at that # position. The first character of the string is at position 0, the next at diff --git a/activesupport/lib/active_support/core_ext/string/filters.rb b/activesupport/lib/active_support/core_ext/string/filters.rb index 70f2dcb562..8644529806 100644 --- a/activesupport/lib/active_support/core_ext/string/filters.rb +++ b/activesupport/lib/active_support/core_ext/string/filters.rb @@ -1,5 +1,3 @@ -require 'active_support/core_ext/string/multibyte' - class String # Returns the string, first removing all whitespace on both ends of # the string, and then changing remaining consecutive whitespace -- cgit v1.2.3 From d64b25438a82541f781a22f42e5cee44acd57737 Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Mon, 28 May 2012 23:32:14 +0300 Subject: make AS::Multibyte::Chars work w/o multibyte core ext Use ActiveSupport::Multibyte::Chars.new instead of String#mb_chars. It allows to use ActiveSupport::Multibyte::Chars without requiring String multibyte core extension. --- activesupport/lib/active_support/multibyte/chars.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index 4fe925f7f4..87b1d76026 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -76,7 +76,7 @@ module ActiveSupport #:nodoc: # # 'Café périferôl'.mb_chars.split(/é/).map { |part| part.upcase.to_s } # => ["CAF", " P", "RIFERÔL"] def split(*args) - @wrapped_string.split(*args).map { |i| i.mb_chars } + @wrapped_string.split(*args).map { |i| self.class.new(i) } end # Works like like String#slice!, but returns an instance of Chars, or nil if the string was not -- cgit v1.2.3