Skip to content

Commit

Permalink
Changed the fallback String#each_char to use valid 1.9 syntax.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
tomlea authored and jeremy committed Nov 23, 2008
1 parent e7208d3 commit 6b06c98
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def self.append_features(base)
# 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
Expand Down

0 comments on commit 6b06c98

Please sign in to comment.