(#13638) Add SemVer#pre function
Before this patch the SemVer#[] method uses a proc to pre-process
version strings, which seems a bit unnecessary when a method would do.
This patch replaces the proc with the SemVer#pre method and updates
the related specs.