I remember there was some interests here about analyzing Ruby programs with MOOSE, and apparently there is a complete Ruby parser done with SmaCC (Smalltalk/X version): https://swing.fit.cvut.cz/projects/smallruby
Look inside the svn repository to find the code. I dunno the licence.
Regards,