diff --git a/lib/haml/util.rb b/lib/haml/util.rb index c9e02e40..c4725444 100644 --- a/lib/haml/util.rb +++ b/lib/haml/util.rb @@ -219,6 +219,8 @@ module Haml def caller_info(entry = caller[1]) info = entry.scan(/^(.*?):(-?.*?)(?::.*`(.+)')?$/).first info[1] = info[1].to_i + # This is added by Rubinius to designate a block, but we don't care about it. + info[2].sub!(/ \{\}\Z/, '') if info[2] info end diff --git a/test/haml/util_test.rb b/test/haml/util_test.rb index 6145aabd..362e1b89 100755 --- a/test/haml/util_test.rb +++ b/test/haml/util_test.rb @@ -211,6 +211,7 @@ class UtilTest < Test::Unit::TestCase assert_equal(["(haml)", 12, "blah"], caller_info("(haml):12: in `blah'")) assert_equal(["", 12, "boop"], caller_info(":12: in `boop'")) assert_equal(["/tmp/foo.rb", -12, "fizzle"], caller_info("/tmp/foo.rb:-12: in `fizzle'")) + assert_equal(["/tmp/foo.rb", 12, "fizzle"], caller_info("/tmp/foo.rb:12: in `fizzle {}'")) end def test_def_static_method