From: RLMuller Date: 2003-09-14T01:43:55+09:00 Subject: Counterpart of __LINE__ from C++ in Ruby? This is a multi-part message in MIME format. ------=_NextPart_000_001C_01C379F4.77D53B30 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi All, Does Ruby offer a global variable like $. or a global method that = provides the line-number in which it appears as opposed to the last line = scanned by Ruby? I've assembled a large script of examples from various Ruby web sites, = which in turn produces a lot of output. It'd be nice if I could just = paste in puts "#{$something}" at various points so that a reader = perusing a portion of the output could easily locate the source code = that generated it. It's no big deal. Ruby seems to have everything in the world in it, so = I thought it might have this, too, though I couldn't find it. Regards, Richard A programmer is a device for turning coffee into code. Jeff Prosise (with an assist from Paul Erdos) ------=_NextPart_000_001C_01C379F4.77D53B30 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Hi All,
 
Does Ruby offer a global variable like $. or a = global method=20 that provides the line-number in which it appears as opposed to the last = line=20 scanned by Ruby?
 
I've assembled a large script of examples from = various Ruby=20 web sites,  which in turn produces a lot of output.  It'd be = nice if I=20 could just paste in puts "#{$something}" at various points so that a = reader=20 perusing a portion of the output could easily locate the source code = that=20 generated it.
 
It's no big deal.  Ruby seems to have = everything in the=20 world in it, so I thought it might have this, too, though I couldn't = find=20 it.
 
Regards,
Richard
 
A programmer is a device for turning coffee into = code.
Jeff=20 Prosise (with an assist from Paul Erdos)
------=_NextPart_000_001C_01C379F4.77D53B30--