enabled `detect_encoding` for ruby 2
Replaced ruby version check by `method_defined?`
Merge pull request #64 from stephanvane/master

enable `detect_encoding!` for ruby 2