From 15b8f9677e27aadf7e3d5ac81cd3aba9a9447d17 Mon Sep 17 00:00:00 2001 From: Tom Lea Date: Thu, 14 Aug 2008 14:23:33 +0100 Subject: [PATCH] Changed the fallback String#each_char to use valid 1.9 syntax. --- .../active_support/core_ext/string/iterators.rb | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/string/iterators.rb b/activesupport/lib/active_support/core_ext/string/iterators.rb index 66a08a5..fe17d14 100644 --- a/activesupport/lib/active_support/core_ext/string/iterators.rb +++ b/activesupport/lib/active_support/core_ext/string/iterators.rb @@ -13,7 +13,9 @@ module ActiveSupport #:nodoc: # When $KCODE = 'UTF8', multi-byte characters are yielded appropriately. def each_char scanner, char = StringScanner.new(self), /./mu - loop { yield(scanner.scan(char) || break) } + while c = scanner.scan(char) + yield c + end end end end -- 1.5.2.4