bower / registry

The Bower registry
https://registry.bower.io/packages
MIT License
292 stars 66 forks source link

Normalize GitHub urls #79

Closed patrickkettner closed 10 years ago

patrickkettner commented 10 years ago

fixes #7

builds on top of #78

ran this though all registered packages and it covers all of them except the following

{
    "name": "ember-build-validations",
    "url": "git://github.com/dockyard/ember-builds/tree/master/validations"
},{
    "name": "grid-generator#1.0.1",
    "url": "git://github.com/martinmaricak/Grid-Generator/releases/tag/1.0.1"
},{
    "name": "kojs",
    "url": "git://github.com/SteveSanderson/knockout/blob/master/build/output/knockout-latest.js"
},{
    "name": "linq",
    "url": "git://github.com/mihaifm/linq/blob/master/linq.js"
},{
    "name": "RangeSlider",
    "url": "git://ghusse.github.com/jQRangeSlider"
},{
    "name": "squeezr",
    "url": "git://github.com/jkphl/squeezr/tree/master/squeezr"
}

All of which are invalid and can't be downloaded anyway.

wibblymat commented 10 years ago

Can you rebase against master so that the diff is clearer to read?

patrickkettner commented 10 years ago

After messing with this for a little bit, the code is way uglier. the url parsing doesn't give much, since it doesn't normalize anything. I still have to go through the entire regex, just one piece of the protocol at a time basically.

As a result, I am going to submit a separate PR for the change, rather than modifying this one, and you guys can pick the one you think looks better