Parsing the Ruby File

Hai any one pls guide me...
We can extract the line number of the sub routine/function/method in a Ruby file using the ctags command.

But I want to know the line number in which the sub routine is ending.

Example:

Say the function get_days_in_hash starts in the line number 20.
It will be returned by the ctags command.
I want to know in which line number that appropriate function is ending.

For each functions in the file I want this informations like starting line of the file and the ending line of the file.

Please help me about how to achieve this.
Thanks in Advance,

Which editor you are using???????????

I am using vim editor.
FYI I want to achieve through a program.
If it is written in Perl I will be more happy :slight_smile: