toland / patron

Ruby HTTP client based on libcurl
http://toland.github.com/patron/
MIT License
541 stars 74 forks source link

Add libcurl_version_exact for fetching version #144

Closed julik closed 7 years ago

julik commented 7 years ago

More and more options in Patron depend on the specific CURL features being available, and that is version dependent. The current libcurl_version method does not provide something that's easily machine-usable or comparable, and since these values are available in the included headers we might as well use them.

Another option would be to use Gem::Version but I am not certain libCURL version semantics are the same as gem version semantics, and then you need your own comparison operator and so forth. Yet another would be to reuse the CURL_VERSION_NUMERIC define, but it needs bit-twiddling to extract the major/minor/patch versions which is not something very Ruby-esque.