Printing Line number during runtime

Hi All,

I am a newbie to ruby programming, Is there a way to print the line
number of the code that ruby is interpreting during runtime without
changing my code?
Can I see what line is ruby running currently?
Is there a command line option?

Thanks in advance!

···

--
Posted via http://www.ruby-forum.com/.

Ash Paratal wrote:

Hi All,

I am a newbie to ruby programming, Is there a way to print the line
number of the code that ruby is interpreting during runtime without
changing my code?
Can I see what line is ruby running currently?
Is there a command line option?

Thanks in advance!

hai friends,
      You can use like this ,it will tell the line number exactly.
Other than that I have not findout any method.wherever you are giving
the the varibales ,it will tell the current line number.

                print __LINE__

by
vellingiri.

···

--
Posted via http://www.ruby-forum.com/\.

No, but you can cook something up with set_trace_func.

Kind regards

robert

···

2007/10/22, Ash Paratal <psash_tal@yahoo.com>:

Hi All,

I am a newbie to ruby programming, Is there a way to print the line
number of the code that ruby is interpreting during runtime without
changing my code?
Can I see what line is ruby running currently?
Is there a command line option?