From b6598c683bb8f8ef484f54755cced77a5d6200bb Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 9 Nov 2009 21:39:32 +0100 Subject: String#each_char is not needed for Ruby >= 1.8.7 --- .../lib/active_support/core_ext/string/iterators.rb | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 activesupport/lib/active_support/core_ext/string/iterators.rb (limited to 'activesupport/lib/active_support/core_ext/string/iterators.rb') diff --git a/activesupport/lib/active_support/core_ext/string/iterators.rb b/activesupport/lib/active_support/core_ext/string/iterators.rb deleted file mode 100644 index 2f8aa84024..0000000000 --- a/activesupport/lib/active_support/core_ext/string/iterators.rb +++ /dev/null @@ -1,13 +0,0 @@ -unless '1.9'.respond_to?(:each_char) - class String - # Yields a single-character string for each character in the string. - # When $KCODE = 'UTF8', multi-byte characters are yielded appropriately. - def each_char - require 'strscan' unless defined? ::StringScanner - scanner, char = ::StringScanner.new(self), /./mu - while c = scanner.scan(char) - yield c - end - end - end -end -- cgit v1.2.3