All Projects → jelly-beam → verl

jelly-beam / verl

Licence: Apache-2.0 license
SemVer 2.0 parsing, matching, and comparisons for Erlang

Programming Languages

erlang
1774 projects
shell
77523 projects
elixir
2628 projects

Projects that are alternatives of or similar to verl

Version
semver (Semantic Version) Swift µFramework.
Stars: ✭ 228 (+714.29%)
Mutual labels:  semver
gradle-semantic-build-versioning
Gradle plugin to generate version-numbers and tags using semantic versioning
Stars: ✭ 19 (-32.14%)
Mutual labels:  semver
semver
Kotlin data class for Semantic Versioning 2.0.0 specification (SemVer)
Stars: ✭ 51 (+82.14%)
Mutual labels:  semver
semver-explain
Explain semver requirements by converting them into less than, greater than, and/or equal to form.
Stars: ✭ 27 (-3.57%)
Mutual labels:  semver
dont-crack
semantic-release plugin checking if the new semantic release is breaking dependent projects
Stars: ✭ 14 (-50%)
Mutual labels:  semver
bin-version-cli
Get the version of a binary in semver format
Stars: ✭ 36 (+28.57%)
Mutual labels:  semver
Nodejs
Node.js基础与应用教程,适合初学者入门,以及有一定经验的开发者提高。Node.js全栈交流QQ群:423652352,node.js或者全栈开发培训QQ群:579500717
Stars: ✭ 202 (+621.43%)
Mutual labels:  semver
turbogit
Opinionated cli enforcing clean git workflow without comprising UX
Stars: ✭ 42 (+50%)
Mutual labels:  semver
ocaml-semver
Semantic version handling for OCaml
Stars: ✭ 16 (-42.86%)
Mutual labels:  semver
next-ver
Tells you the next semantic version for your local package
Stars: ✭ 27 (-3.57%)
Mutual labels:  semver
git-version-bumper
Bump your git tag to the next version, easily. 👊
Stars: ✭ 92 (+228.57%)
Mutual labels:  semver
semver-cli
semver-cli is a simple command line tool to compare and manipulate version strings.
Stars: ✭ 28 (+0%)
Mutual labels:  semver
probot-semver
A GitHub app that provides automatic semantic versioning support
Stars: ✭ 15 (-46.43%)
Mutual labels:  semver
Gitmoji Changelog
A changelog generator for gitmoji 😜
Stars: ✭ 250 (+792.86%)
Mutual labels:  semver
gradle-versioner
Gradle Version Plugin. Generates semantic versions with git meta data per branch.
Stars: ✭ 25 (-10.71%)
Mutual labels:  semver
Bumped
📦 Makes easy release software
Stars: ✭ 222 (+692.86%)
Mutual labels:  semver
ongeza
An automated way to follow the Semantic Versioning Specification
Stars: ✭ 36 (+28.57%)
Mutual labels:  semver
zerover
0️⃣ Minimalist versioning scheme for devs who can't be bothered.
Stars: ✭ 141 (+403.57%)
Mutual labels:  semver
semver-generator
Semantic version generator using git commit keywords and overrides
Stars: ✭ 26 (-7.14%)
Mutual labels:  semver
cocogitto
The Conventional Commits toolbox
Stars: ✭ 242 (+764.29%)
Mutual labels:  semver

verl

Hex Version GitHub Actions CI codecov

SemVer 2.0 version and requirements parsing, matching, and comparisons.

All parsing of versions and requirements adhere to the SemVer 2.0 schema

Build

$ rebar3 compile

Test

$ rebar3 test

Usage

Add to you deps configuration in rebar.config for your project :

{deps, [{verl, "1.1.0"}]}.

Comparisons

1> verl:compare(<<"1.0.0">>, <<"1.0.1">>).
lt
2> verl:compare(<<"1.0.0">>, <<"1.0.0">>).
eq
3> verl:compare(<<"2.0.0">>, <<"1.0.0">>).
gt
4> verl:compare(<<"1.0.0-pre">>, <<"1.0.0">>).
lt
5> verl:compare(<<"1.0.0">>, <<"1.0.0-pre">>).
gt

Version, Requirements, and Matching

Matching

1> verl:is_match(<<"1.0.0">>, <<"~> 1.0.0">>).
true
2> verl:is_match(<<"1.0.0">>, <<"~> 2.0.0">>).
false
3> verl:is_match(<<"3.2.0">>, <<"~> 3.0.0">>).
false
4> verl:is_match(<<"3.2.0">>, <<"~> 3.0">>).
true

Compiled requirements for ludicious speed matching

1> {ok, Req} = verl:parse_requirement(<<"~> 3.0">>).
{ok,#{compiled => false,
  string => <<"~> 3.0">>,
  matchspec => [{{'$1','$2','$3','$4','$5'}...}],
  string => <<"~> 3.0">>}}
2> verl:is_match(<<"3.0.0-dev">>, Req).
  false
3> verl:is_match(<<"1.2.3">>, Req).
  false
4> verl:is_match(<<"3.1.0">>, Req).
  true

Version parsing

1> verl:parse(<<"1.2.3">>).
#{build => undefined,major => 1,minor => 2,patch => 3,
  pre => []}
2> verl:parse(<<"1.2.3+build">>).
#{build => <<"build">>,major => 1,minor => 2,patch => 3,
  pre => []}
3> verl:parse(<<"1.2.3-pre+build">>).
#{build => <<"build">>,major => 1,minor => 2,patch => 3,
  pre => [<<"pre">>]}
4> verl:parse(<<"1">>).
{error, invalid_version}
5> verl:parse(<<"2">>).
{error, invalid_version}

Don't want a map? Use the verl_parser module...

1> verl_parser:parse_version(<<"1.2.3">>).
{ok,{1,2,3,[],[]}}
2> verl_parser:parse_version(<<"1.2.3+build">>).
{ok,{1,2,3,[],[<<"build">>]}}
3> verl_parser:parse_version(<<"1.2.3-pre+build">>).
{ok,{1,2,3,[<<"pre">>],[<<"build">>]}}
4> verl_parser:parse_version(<<"1">>).
{error, invalid_version}
Requirements parsing
1> verl:parse_requirement(<<"~> 2.1.0-dev">>).
{ok,#{compiled => false,
  string => <<"~> 2.1.0-dev">>,
  matchspec =>
      [{{'$1','$2','$3','$4','$5'}...] }}
2> verl:parse_requirement(<<"~> 2.1.0-">>).
{error,invalid_requirement}

Don't want a map? User the verl_parser module...

1> verl_parser:parse_requirement(<<"~> 2.1.0-dev">>).
{ok, [{{'$1','$2','$3','$4','$5'}...]}
2> verl:parse_requirement(<<"~> 2.1.0-">>).
{error,invalid_requirement}

Credits

  • All credit goes to the Elixir team and contributors to Version and Version.Parser in the Elixir standard lib for the algorithm and original implementation.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].