Ripper2Ruby builds an object-oriented representation of Ruby code that you can modify and recompile back to Ruby.
Sven Fuchs
gem "ripper2ruby", "~> 0.0.1"