Fix ruby engine detection such that it detects Ruby 1.8.7

Based on bundler's ruby engine detection:

https://github.com/carlhuda/bundler/blob/438ef20987951883cb5837d245eac9c517848b2d/lib/bundler/ruby_version.rb
Merge pull request #7 from nate/bugfix/ruby-1-8-7-detection

Fix ruby engine detection such that it detects Ruby 1.8.7