When a call is made to a method, you can get the line number of the command where the call was made:
loc = caller_locations(1, 1).first
loc.lineno # => 3 (or whatever the line number is)
I use that information for a little home brewed debugging tool I use.
It would be nice (though not required) if I could get the total number of lines in the calling file. That way I could output something like this:
3/122
It wouldn't be worth the cost of manually counting up the number of lines in the file by using loc.path. Does Ruby provide a cheap way to get the line count?