diff --git a/ChangeLog b/ChangeLog index 0103156e0e..660ed9f8e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Oct 17 22:03:08 2006 Minero Aoki + + * lib/erb.rb: String#each was removed, use #each_line instead. + Tue Oct 17 08:04:31 2006 Yukihiro Matsumoto * string.c (rb_str_lines): now takes optional argument for the diff --git a/lib/erb.rb b/lib/erb.rb index b714aa1ea6..02c96db83d 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -304,11 +304,11 @@ class ERB def scan(&block) @stag = nil if @percent - @src.each do |line| + @src.each_line do |line| percent_line(line, &block) end else - @src.each do |line| + @src.each_line do |line| @scan_line.call(line, &block) end end @@ -392,7 +392,7 @@ class ERB class SimpleScanner < Scanner # :nodoc: def scan - @src.each do |line| + @src.each_line do |line| line.split(SplitRegexp).each do |token| next if token.empty? yield(token)