Files
shields/lib
Pyves 7039e68018 Consistent version formatting (#1246)
Provide greater consistency for badges related to versions. Fix #1181.

- the `version` function in `color-formatters` was previously returning the colour of the badge, but also its text with a leading _v_. It was broken down into two separate functions and the text formatting part was moved to `text-formatters`, where it really belongs.

- unit tests were added for these two functions in `color-formatters.spec` and `text-formatters.spec`, using Sazerac.

- as discussed in #1181, the leading _v_ was omitted  for _xxxx-yy-zz_ date patterns. Any future exceptions can easily be added to the `ignoredVersionPatterns` pattern.

- the badge colour was previously switched to orange if a hyphen was found in the version string. This didn't seem ideal, instead pattern matching is done to find keywords such as `beta`, `alpha` or `snapshot`. Of course, this list can easily be extended.

- all badges related to versions now use the `versionText` and `versionColor` functions. There are a few rare exceptions, for instance in cases where the data returned by the service's API allows to figure things out without relying on any parsing/pattern matching (eg. `badgeData.colorscheme = prerelease ? 'orange' : 'blue';`, where `prerelease` is determined from an API's response).
2017-11-11 17:54:38 -05:00
..
2017-10-31 23:13:23 -04:00
2017-10-30 21:46:50 -04:00
2017-03-26 22:57:55 +02:00
2017-10-06 13:11:29 -04:00
2017-09-24 22:36:14 +02:00
2017-10-06 13:11:29 -04:00
2017-10-06 13:11:29 -04:00
2017-10-06 13:11:29 -04:00
2017-10-31 23:13:23 -04:00
2017-10-31 23:13:23 -04:00
2017-10-31 23:13:23 -04:00