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!

Ash P. 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.

2007/10/22, Ash P. [email protected]:

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?

No, but you can cook something up with set_trace_func.

Kind regards

robert

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs