It's called libjsw2 or libjsw2-dev (at least it's available for debian / sidux and should be distributed under the GPL or LGPL) and it's meant to provide Linux the ability to use joysticks alias gamepads, obviously. I also found this link...
http://appliedstochastics.com/articles/ruby_jsw.html...with a source code at the bottom of the page. This webpage has a bit of info regarding how to use libjsw2 in SWIG and Ruby that might interest you (and the rest of us as well).