Extract Current Ruby version/platform detection from dependency.rb

That can be reused across several places in bundler and hence
extracted that code which is responsible for properly
detecting current ruby version.
Merge pull request #2545 from bundler/refactor-platform-detection

Extract Current Ruby version/platform detection from dependency.rb