From: Christer Nilsson Date: 2005-12-06T23:20:55+09:00 Subject: How can I find __LINE__ on the execution stack ? I would like to be able to display the line number in my simple assert. 1 def assert(expect, actual, *msg) 2 expect==actual ? print(".") : print("\nAssert at line #{__LINE__} failed: #{expect.inspect} <> #{actual.inspect} #{msg}\n") 3 end 4 5 assert 1, 2 6 assert 1, 1 The solution above erroneously displays line 2 instead of line 5. Christer -- Posted via http://www.ruby-forum.com/.