Version grammar

How Ripstop reads and orders version strings. Getting this wrong is how a force-update rule walls the wrong people, so it is specified rather than left to each platform’s idea of semver.

The grammar

Grammar
[0-9]+(\.[0-9]+){0,3}  ( -prerelease )?  ( +build )?
  • Up to four segments, because Android versionNames are routinely 4.11.0.2.
  • Missing segments are zero: 1.2 and 1.2.0 are the same version.
  • Leading zeros are insignificant: 01.002.0003 equals 1.2.3.
  • Build metadata is ignored entirely: 1.2.3+45 equals 1.2.3.
  • A pre-release precedes its release: 3.0.0-rc.1 is below 3.0.0.

Pre-release ordering

Semver 2.0 rules, compared identifier by identifier:

RuleExample
Numeric identifiers compare numericallyrc.2 < rc.10
Numeric sorts before alphanumeric1.0.0-1 < 1.0.0-alpha
Alphanumeric compares lexicallyalpha < beta
A shorter prefix sorts first1.0.0-alpha < 1.0.0-alpha.1

Strings that are not versions

Anything outside the grammar is invalid, and invalid is not an error. Version-dependent rules simply do not match, so the decision falls through to none and the app runs.

This is deliberate: a typo in your version string must never be able to lock a user out. Maintenance is unaffected either way: it applies to every build, so it never consults the version at all.

⌘K