Raumod is a project mainly written in Ruby, it's free.
MOD/XM lib in pure Ruby
Supposed to be a XM/MOD format handler for ruby. But it's in early pre alpha stages right now so come back later.