dark-panda / ffi-geos

ffi-geos is an implementation of the GEOS Ruby bindings in Ruby via FFI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrectly parsing geos version 3.8.0

azhi opened this issue · comments

commented

In 3.8.0, geos devs decided to remove git revision hash from capi version (libgeos/geos@7699310#diff-8dd96440c9832c59176dcaa7c346b982R3549).
Unfortunately, they left whitespace at the end, so now this regex is broken again -

ffi-geos/lib/ffi-geos.rb

Lines 1284 to 1289 in 2662d85

if !(versions = Geos.version.scan(/^
((\d+)\.(\d+)\.(\d+)((?:dev|rc|beta|alpha)\d*)?)
-CAPI-
((\d+)\.(\d+)\.(\d+))
(?:\s+r?(\h+))?
$/x)).empty?
.

Example of broken version:

> Geos.version
=> "3.8.0-CAPI-1.13.1 "
> Geos::GEOS_VERSION
=> "0.0.0"

PS: I've create a PR to geos to remove unnecessary whitespace, so it hopefully will be fixed in next geos release. Not sure if you want to hack release regex to make 3.8.0 work.

commented

Fixed in 9c51273. Will release a new version soon, just going to do a little bit of clean up first.