added jruby and rubinius compatibility