adhere to ruby 1.8.7 syntax
add support for jruby and ruby 1.8.7