badges / gh-badges

Go to badges/shields. Especially if you don't know why. (This repo is old.)
http://img.shields.io/
Creative Commons Zero v1.0 Universal
86 stars 29 forks source link

Add Packagist latest version badge #39

Closed rmasters closed 10 years ago

rmasters commented 10 years ago

Similar to the version badges at https://poser.pugx.org/, example: symfony release

Finds the latest unstable or stable version from package.versions. Colours similarly to NPM (dev-master/0.* is orange, >=1.* is blue).

Supposedly versions are in descending order on the Packagist response but I'm not sure I trust JSON to stay in order. Possible optimisation but Symfony has a bunch of versions and is fairly quick to render.

Given I don't work with Node that often, please let me know of any sins I have committed!

rmasters commented 10 years ago

Example for next deploy Poser

espadrine commented 10 years ago

Thanks! It's deployed now.

I'm not sure why, on line 230, you have a series of branches, all of which result in version = v.

rmasters commented 10 years ago

Sorry I should have put at least one comment in there. As Packagist doesn't directly give the latest version, it's trying to make an educated guess. Goes something like:

I'll clean it up a bit - version should really be latest or something.