Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ngot/fibjs-github-url-from-git

github-url-from-git for fibjs
https://github.com/ngot/fibjs-github-url-from-git

Last synced: about 2 months ago
JSON representation

github-url-from-git for fibjs

Awesome Lists containing this project

README

        

# github-url-from-git

```js
describe('parse(url)', function(){
it('should support git://*', function(){
var url = 'git://github.com/jamesor/mongoose-versioner';
assert.equal(parse(url), 'https://github.com/jamesor/mongoose-versioner');
})

it('should support git://*.git', function(){
var url = 'git://github.com/treygriffith/cellar.git';
assert.equal(parse(url), 'https://github.com/treygriffith/cellar');
})

it('should support https://*', function(){
var url = 'https://github.com/Empeeric/i18n-node';
assert.equal(parse(url), 'https://github.com/Empeeric/i18n-node');
})

it('should support https://*.git', function(){
var url = 'https://[email protected]/banchee/tranquil.git';
assert.equal(parse(url), 'https://github.com/banchee/tranquil');
})

it('should return undefined on failure', function(){
var url = 'git://github.com/justgord/.git';
assert.equal(null, parse(url));
})

it('should parse git@gist urls', function() {
var url = '[email protected]:3135914.git';
assert.equal(parse(url), 'https://gist.github.com/3135914')
})

it('should parse https://gist urls', function() {
var url = 'https://gist.github.com/3135914.git';
assert.equal(parse(url), 'https://gist.github.com/3135914')
})
})
```