From 9e90db45b35303efb85f69f988062f0589dde3ad Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 19 Oct 2012 14:33:46 +0200 Subject: [PATCH] Add docs for ~ operator --- doc/01-basic-usage.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/01-basic-usage.md b/doc/01-basic-usage.md index 9daf03064..5ffad801d 100644 --- a/doc/01-basic-usage.md +++ b/doc/01-basic-usage.md @@ -64,7 +64,7 @@ development branch. It would match `1.0.0`, `1.0.2` or `1.0.20`. Version constraints can be specified in a few different ways. * **Exact version:** You can specify the exact version of a package, for - example `1.0.2`. This is not used very often, but can be useful. + example `1.0.2`. * **Range:** By using comparison operators you can specify ranges of valid versions. Valid operators are `>`, `>=`, `<`, `<=`, `!=`. An example range @@ -72,7 +72,14 @@ Version constraints can be specified in a few different ways. `>=1.0,<2.0`. * **Wildcard:** You can specify a pattern with a `*` wildcard. `1.0.*` is the - equivalent of `>=1.0,<1.1-dev`. + equivalent of `>=1.0,<1.1`. + +* **Next Significant Release (Tilde Operator):** The `~` operator is best + explained by example: `~1.2` is equivalent to `>=1.2,<2.0`, while `~1.2.3` is + equivalent to `>=1.2.3,<1.3`. As you can see it is mostly useful for projects + respecting semantic versioning. A common usage would be to mark the minimum + minor version you depend on, like `~1.2`, since in theory there should be no + backwards compatibility breaks until 2.0, that works well. ## Installing Dependencies