mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/erb.rb: String#each was removed, use #each_line instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1fe4c7af5b
commit
2f32af52c4
2 changed files with 7 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Oct 17 22:03:08 2006 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
* lib/erb.rb: String#each was removed, use #each_line instead.
|
||||||
|
|
||||||
Tue Oct 17 08:04:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Oct 17 08:04:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* string.c (rb_str_lines): now takes optional argument for the
|
* string.c (rb_str_lines): now takes optional argument for the
|
||||||
|
|
|
@ -304,11 +304,11 @@ class ERB
|
||||||
def scan(&block)
|
def scan(&block)
|
||||||
@stag = nil
|
@stag = nil
|
||||||
if @percent
|
if @percent
|
||||||
@src.each do |line|
|
@src.each_line do |line|
|
||||||
percent_line(line, &block)
|
percent_line(line, &block)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@src.each do |line|
|
@src.each_line do |line|
|
||||||
@scan_line.call(line, &block)
|
@scan_line.call(line, &block)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -392,7 +392,7 @@ class ERB
|
||||||
|
|
||||||
class SimpleScanner < Scanner # :nodoc:
|
class SimpleScanner < Scanner # :nodoc:
|
||||||
def scan
|
def scan
|
||||||
@src.each do |line|
|
@src.each_line do |line|
|
||||||
line.split(SplitRegexp).each do |token|
|
line.split(SplitRegexp).each do |token|
|
||||||
next if token.empty?
|
next if token.empty?
|
||||||
yield(token)
|
yield(token)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue