diff options
author | Tom Lea <contrib@tomlea.co.uk> | 2008-08-14 14:23:33 +0100 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-22 22:01:01 -0800 |
commit | 6b06c9870aef6c44b99ae07ae8ddcbc4bfb13221 (patch) | |
tree | 9e9ea1f831b2d58bb8f7fd1f76c0ca7859048004 /activesupport/lib/active_support | |
parent | e7208d382a3d8bae9ab13d8a380b1a2a05fd99b0 (diff) | |
download | rails-6b06c9870aef6c44b99ae07ae8ddcbc4bfb13221.tar.gz rails-6b06c9870aef6c44b99ae07ae8ddcbc4bfb13221.tar.bz2 rails-6b06c9870aef6c44b99ae07ae8ddcbc4bfb13221.zip |
Changed the fallback String#each_char to use valid 1.9 syntax.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/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 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 |