aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorTom Lea <contrib@tomlea.co.uk>2008-08-14 14:23:33 +0100
committerJeremy Kemper <jeremy@bitsweat.net>2008-11-22 22:01:01 -0800
commit6b06c9870aef6c44b99ae07ae8ddcbc4bfb13221 (patch)
tree9e9ea1f831b2d58bb8f7fd1f76c0ca7859048004 /activesupport/lib
parente7208d382a3d8bae9ab13d8a380b1a2a05fd99b0 (diff)
downloadrails-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')
-rw-r--r--activesupport/lib/active_support/core_ext/string/iterators.rb4
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