fix code to retain compatibility with 1.8 syntax
add jruby detection helper
disable spec using fork when run on jruby