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.
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.