summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-02 07:10:35 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-02 07:10:35 +0000
commit16d65fd118e9053bb0b2ff3f958f3c6509c2ac38 (patch)
treeeb283439863169c049e919b30560bf4e69abf917 /lib
parent51e8934abdad232a5fd921a55a1c07b695abb8ba (diff)
downloadruby-16d65fd118e9053bb0b2ff3f958f3c6509c2ac38.tar.gz
ruby-16d65fd118e9053bb0b2ff3f958f3c6509c2ac38.tar.xz
ruby-16d65fd118e9053bb0b2ff3f958f3c6509c2ac38.zip
* lib/erb.rb (ERB::Compiler::TrimScanner#scan_line): Fix a bug
where tokens are not yilelded one by one. * test/erb/test_erb.rb (TestERBCore#_test_01) (TestERBCore#test_02_safe_04): The expected value should come first for assert_equal(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/erb.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/erb.rb b/lib/erb.rb
index fade2c72b..58f98ca00 100644
--- a/lib/erb.rb
+++ b/lib/erb.rb
@@ -329,15 +329,17 @@ class ERB
end
def scan_line(line)
- line.split(SplitRegexp).each do |token|
- next if token.empty?
- yield(token)
+ line.split(SplitRegexp).each do |tokens|
+ tokens.each do |token|
+ next if token.empty?
+ yield(token)
+ end
end
end
def trim_line1(line)
line.split(TrimSplitRegexp).each do |token|
- next if token.empty?
+ next if token.empty?
if token == "%>\n"
yield('%>')
yield(:cr)