lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi there,

if you intend it to parse version strings of existing packages that use
3-part version numbers, I don't think it will.

Thanks for your comments. 

My intention with semver was implementing what the page says; hence its name.

Since doesn't contemplate anything before the version numbers, so the lib doesn't implement that.

There is also an interface problem. The lib accepts two kinds of parameters - either you pass in a string for it to "parse", or you pass every number separatedly:


Right now both versions of the constructor are aligned - they throw errors on the same kind of things. I think it would be weird to accept an "extra" string bit on the string-only constructor.

A lib implementing those features should not be called semver - maybe luaversion, or similar. Please don't misunderstand me: I'm not saying it's a bad idea to make such a lib - I just think semver is just not the place.

Until such a lib is done, one can use :match("[^ ]+$") : 

> = _VERSION:match("[^ ]+$")
> = socket._VERSION:match("[^ ]+$")

I hope this helps.