From 6b06c9870aef6c44b99ae07ae8ddcbc4bfb13221 Mon Sep 17 00:00:00 2001 From: Tom Lea Date: Thu, 14 Aug 2008 14:23:33 +0100 Subject: Changed the fallback String#each_char to use valid 1.9 syntax. Signed-off-by: Jeremy Kemper --- activesupport/lib/active_support/core_ext/string/iterators.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/string/iterators.rb b/activesupport/lib/active_support/core_ext/string/iterators.rb index 66a08a5cd0..fe17d140ca 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 -- cgit v1.2.3