Select correct parser depending on ruby version.

Removes "warning: URI.escape is obsolete" warnings which pop up continuously
during tests of apps / libraries which use this one.