Added support for ruby version 2.x

This version should work on ruby version 2.x, not tested yet on older versions.