diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-03-20 03:18:04 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-03-20 03:18:04 +0300 |
commit | 89ce829a00b526d0518f5cd855c323bffe182af0 (patch) | |
tree | 50b4ed1ad38f5fe8712d084a3b9359a4e9a8cd06 /node_modules/npm-package-arg | |
parent | 63313eb0c37891c355546fd1093010c8a0c3cd81 (diff) |
hosted-git-info@1.5.3
Use `hosted-git-info` directly to ensure that all GitHub URLs are being
run through the same cloning strategy for caching. Fixes #7630.
Diffstat (limited to 'node_modules/npm-package-arg')
12 files changed, 0 insertions, 609 deletions
diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/.npmignore b/node_modules/npm-package-arg/node_modules/hosted-git-info/.npmignore deleted file mode 100644 index 58e97a787..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -*~ -.# -node_modules diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/.travis.yml b/node_modules/npm-package-arg/node_modules/hosted-git-info/.travis.yml deleted file mode 100644 index 7dc661917..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.11" - - "0.10" -script: "npm test" diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md b/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md deleted file mode 100644 index ebf40a2ab..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# hosted-git-info - -This will let you identify and transform various git hosts URLs between -protocols. It also can tell you what the URL is for the raw path for -particular file for direct access without git. - -## Usage - -```javascript -var hostedGitInfo = require("hosted-git-info") -var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git") -/* info looks like: -{ - type: "github", - domain: "github.com", - user: "npm", - project: "hosted-git-info" -} -*/ -``` - -If the URL can't be matched with a git host, `null` will be returned. We -can match git, ssh and https urls. Additionally, we can match ssh connect -strings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg, -`github:npm/hosted-git-info`). Github specifically, is detected in the case -of a third, unprefixed, form: `npm/hosted-git-info`. - -If it does match, the returned object has properties of: - -* info.type -- The short name of the service -* info.domain -- The domain for git protocol use -* info.user -- The name of the user/org on the git host -* info.project -- The name of the project on the git host - -And methods of: - -* info.file(path) - -Given the path of a file relative to the repository, returns a URL for -directly fetching it from the githost. If no comittish was set then -`master` will be used as the default. - -For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")` -would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json` - -* info.shortcut() - -eg, `github:npm/hosted-git-info` - -* info.browse() - -eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0` - -* info.bugs() - -eg, `https://github.com/npm/hosted-git-info/issues` - -* info.docs() - -eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme` - -* info.https() - -eg, `https://github.com/npm/hosted-git-info.git` - -* info.sshurl() - -eg, `git+ssh://git@github.com/npm/hosted-git-info.git` - -* info.ssh() - -eg, `git@github.com:npm/hosted-git-info.git` - -* info.path() - -eg, `npm/hosted-git-info` - -## Supported hosts - -Currently this supports Github, Bitbucket and Gitlab. Pull requests for -additional hosts welcome. - diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md~ b/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md~ deleted file mode 100644 index f6f1dcf9e..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md~ +++ /dev/null @@ -1,88 +0,0 @@ -# hosted-git-info - -This will let you identify and transform various git hosts URLs between -protocols. It also can tell you what the URL is for the raw path for -particular file for direct access without git. - -## Usage - -```javascript -var hostedGitInfo = require("hosted-git-info") -var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git") -/* info looks like: -{ - type: "github", - domain: "github.com", - user: "npm", - project: "hosted-git-info" -} -*/ -``` - -If the URL can't be matched with a git host, `null` will be returned. We -can match git, ssh and https urls. Additionally, we can match ssh connect -strings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg, -`github:npm/hosted-git-info`). Github specifically, is detected in the case -of a third, unprefixed, form: `npm/hosted-git-info`. - -If it does match, the returned object has properties of: - -* info.type -- The short name of the service -* info.domain -- The domain for git protocol use -* info.user -- The name of the user/org on the git host -* info.project -- The name of the project on the git host - -And methods of: - -* info.file(path) - -Given the path of a file relative to the repository, returns a URL for -directly fetching it from the githost. If no comittish was set then -`master` will be used as the default. - -<<<<<<< HEAD -For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")` -||||||| merged common ancestors -For example `hostedGitInfo("git@github.com:npm/hosted-git-info.git").file("v1.0.0")` -======= -For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git").file("v1.0.0")` ->>>>>>> Another README fix -would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json` - -* info.shortcut() - -eg, `github:npm/hosted-git-info` - -* info.browse() - -eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0` - -* info.bugs() - -eg, `https://github.com/npm/hosted-git-info/issues` - -* info.docs() - -eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme` - -* info.https() - -eg, `https://github.com/npm/hosted-git-info.git` - -* info.sshurl() - -eg, `git+ssh://git@github.com/npm/hosted-git-info.git` - -* info.ssh() - -eg, `git@github.com:npm/hosted-git-info.git` - -* info.path() - -eg, `npm/hosted-git-info` - -## Supported hosts - -Currently this supports Github, Bitbucket and Gitlab. Pull requests for -additional hosts welcome. - diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js b/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js deleted file mode 100644 index c2ad10a3b..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js +++ /dev/null @@ -1,208 +0,0 @@ -"use strict" -var url = require("url") - -var GitHost = exports = module.exports = function (type, user, project, comittish) { - this.type = type - this.domain = gitHosts[type].domain - this.filetemplate = gitHosts[type].filetemplate - this.sshtemplate = gitHosts[type].sshtemplate - this.sshurltemplate = gitHosts[type].sshurltemplate - this.browsetemplate = gitHosts[type].browsetemplate - this.docstemplate = gitHosts[type].docstemplate - this.bugstemplate = gitHosts[type].bugstemplate - this.gittemplate = gitHosts[type].gittemplate - this.httpstemplate = gitHosts[type].httpstemplate - this.treepath = gitHosts[type].treepath - this.user = user - this.project = project - this.comittish = comittish -} -GitHost.prototype = {} - -exports.fromUrl = function (giturl) { - if (giturl == null || giturl == "") return - var parsed = parseGitUrl(maybeGitHubShorthand(giturl) ? "github:" + giturl : giturl) - var matches = Object.keys(gitHosts).map(function(V) { - var gitHost = gitHosts[V] - var comittish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null - if (parsed.protocol == V + ":") { - return new GitHost(V, - decodeURIComponent(parsed.host), decodeURIComponent(parsed.path.replace(/^[/](.*?)(?:[.]git)?$/, "$1")), comittish) - } - if (parsed.host != gitHost.domain) return - if (! gitHost.protocols_re.test(parsed.protocol)) return - var matched = parsed.path.match(gitHost.pathmatch) - if (! matched) return - return new GitHost( - V, - matched[1]!=null && decodeURIComponent(matched[1]), - matched[2]!=null && decodeURIComponent(matched[2]), - comittish) - }).filter(function(V){ return V }) - if (matches.length != 1) return - return matches[0] -} - -function maybeGitHubShorthand(arg) { - // Note: This does not fully test the git ref format. - // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html - // - // The only way to do this properly would be to shell out to - // git-check-ref-format, and as this is a fast sync function, - // we don't want to do that. Just let git fail if it turns - // out that the commit-ish is invalid. - // GH usernames cannot start with . or - - return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg) -} - -var parseGitUrl = function (giturl) { - if (typeof giturl != "string") giturl = "" + giturl - var matched = giturl.match(/^([^@]+)@([^:]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) - if (! matched) return url.parse(giturl) - return { - protocol: "git+ssh:", - slashes: true, - auth: matched[1], - host: matched[2], - port: null, - hostname: matched[2], - hash: matched[4], - search: null, - query: null, - pathname: "/" + matched[3], - path: "/" + matched[3], - href: "git+ssh://" + matched[1] + "@" + matched[2] + "/" + matched[3] + (matched[4]||"") - } -} - -var gitHostDefaults = { - "sshtemplate": "git@{domain}:{user}/{project}.git{#comittish}", - "sshurltemplate": "git+ssh://git@{domain}/{user}/{project}.git{#comittish}", - "browsetemplate": "https://{domain}/{user}/{project}{/tree/comittish}", - "docstemplate": "https://{domain}/{user}/{project}{/tree/comittish}#readme", - "httpstemplate": "https://{domain}/{user}/{project}.git{#comittish}", - "filetemplate": "https://{domain}/{user}/{project}/raw/{comittish}/{path}" -} -var gitHosts = { - github: { - // First two are insecure and generally shouldn't be used any more, but - // they are still supported. - "protocols": [ "git", "http", "git+ssh", "git+https", "ssh", "https" ], - "domain": "github.com", - "pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/, - "treepath": "tree", - "filetemplate": "https://raw.githubusercontent.com/{user}/{project}/{comittish}/{path}", - "bugstemplate": "https://{domain}/{user}/{project}/issues", - "gittemplate": "git://{domain}/{user}/{project}.git{#comittish}" - }, - bitbucket: { - "protocols": [ "git+ssh", "git+https", "ssh", "https" ], - "domain": "bitbucket.org", - "pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/, - "treepath": "src" - }, - gitlab: { - "protocols": [ "git+ssh", "git+https", "ssh", "https" ], - "domain": "gitlab.com", - "pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/, - "treepath": "tree", - "docstemplate": "https://{domain}/{user}/{project}{/tree/comittish}#README", - "bugstemplate": "https://{domain}/{user}/{project}/issues" - }, - gist: { - "protocols": [ "git", "git+ssh", "git+https", "ssh", "https" ], - "domain": "gist.github.com", - "pathmatch": /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/, - "filetemplate": "https://gist.githubusercontent.com/{user}/{project}/raw{/comittish}/{path}", - "bugstemplate": "https://{domain}/{project}", - "gittemplate": "git://{domain}/{project}.git{#comittish}", - "sshtemplate": "git@{domain}:/{project}.git{#comittish}", - "sshurltemplate": "git+ssh://git@{domain}/{project}.git{#comittish}", - "browsetemplate": "https://{domain}/{project}{/comittish}", - "docstemplate": "https://{domain}/{project}{/comittish}", - "httpstemplate": "https://{domain}/{project}.git{#comittish}", - }, -} - -Object.keys(gitHosts).forEach(function(host) { - gitHosts[host].protocols_re = RegExp("^(" + - gitHosts[host].protocols.map(function(P){ - return P.replace(/([\\+*{}()\[\]$^|])/g, "\\$1") - }).join("|") + "):$") -}) - -GitHost.prototype.shortcut = function () { - return this.type + ":" + this.path() -} - -GitHost.prototype.hash = function () { - return this.comittish ? "#" + this.comittish : "" -} - -GitHost.prototype.path = function () { - return this.user + "/" + this.project + this.hash() -} - -GitHost.prototype._fill = function (template, vars) { - if (!template) throw new Error("Tried to fill without template") - if (!vars) vars = {} - var self = this - Object.keys(this).forEach(function(K){ if (self[K]!=null && vars[K]==null) vars[K] = self[K] }) - var rawComittish = vars.comittish - Object.keys(vars).forEach(function(K){ (K[0]!='#') && (vars[K] = encodeURIComponent(vars[K])) }) - vars["#comittish"] = rawComittish ? "#" + rawComittish : "" - vars["/tree/comittish"] = vars.comittish ? "/"+vars.treepath+"/" + vars.comittish : "", - vars["/comittish"] = vars.comittish ? "/" + vars.comittish : "" - vars.comittish = vars.comittish || "master" - var res = template - Object.keys(vars).forEach(function(K){ - res = res.replace(new RegExp("[{]" + K + "[}]", "g"), vars[K]) - }) - return res -} - -GitHost.prototype.ssh = function () { - var sshtemplate = this.sshtemplate || gitHostDefaults.sshtemplate - return this._fill(sshtemplate) -} - -GitHost.prototype.sshurl = function () { - var sshurltemplate = this.sshurltemplate || gitHostDefaults.sshurltemplate - return this._fill(sshurltemplate) -} - -GitHost.prototype.browse = function () { - var browsetemplate = this.browsetemplate || gitHostDefaults.browsetemplate - return this._fill(browsetemplate) -} - -GitHost.prototype.docs = function () { - var docstemplate = this.docstemplate || gitHostDefaults.docstemplate - return this._fill(docstemplate) -} - -GitHost.prototype.bugs = function() { - if (! this.bugstemplate) return - return this._fill(this.bugstemplate) -} - -GitHost.prototype.https = function () { - var httpstemplate = this.httpstemplate || gitHostDefaults.httpstemplate - return this._fill(httpstemplate) -} - -GitHost.prototype.git = function () { - if (! this.gittemplate) return - return this._fill(this.gittemplate) -} - -GitHost.prototype.file = function (P) { - var filetemplate = this.filetemplate || gitHostDefaults.filetemplate - return this._fill(filetemplate, { - path: P.replace(/^[/]+/g, "") - }) -} - -GitHost.prototype.toString = function () { - return this[this.default||"sshurl"]() -} diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json b/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json deleted file mode 100644 index 00606f6a4..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "hosted-git-info", - "version": "1.5.3", - "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", - "main": "index.js", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/hosted-git-info.git" - }, - "keywords": [ - "git", - "github", - "bitbucket", - "gitlab" - ], - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/hosted-git-info/issues" - }, - "homepage": "https://github.com/npm/hosted-git-info", - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "^0.4.13" - }, - "gitHead": "153325f997813ebf8a7ae07b322b4fa89aa25f7d", - "_id": "hosted-git-info@1.5.3", - "_shasum": "1f46e25e9c0e207852fb7a4b94422ed5f09a03f5", - "_from": "hosted-git-info@>=1.5.3 <2.0.0", - "_npmVersion": "2.4.0", - "_nodeVersion": "0.10.33", - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" - }, - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - } - ], - "dist": { - "shasum": "1f46e25e9c0e207852fb7a4b94422ed5f09a03f5", - "tarball": "http://registry.npmjs.org/hosted-git-info/-/hosted-git-info-1.5.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-1.5.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/basic.js b/node_modules/npm-package-arg/node_modules/hosted-git-info/test/basic.js deleted file mode 100644 index e56ef9a05..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/basic.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict" -var HostedGit = require("../index") -var test = require("tap").test - -test("basic", function (t) { - t.is(HostedGit.fromUrl("https://google.com"), undefined, "null on failure") - - t.end() -}) diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/bitbucket.js b/node_modules/npm-package-arg/node_modules/hosted-git-info/test/bitbucket.js deleted file mode 100644 index 089cb2819..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/bitbucket.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict" -var HostedGit = require("../index") -var test = require("tap").test - -test("fromUrl(bitbucket url)", function (t) { - function verify(host, label, branch) { - var hostinfo = HostedGit.fromUrl(host) - var hash = branch ? "#" + branch : "" - t.ok(hostinfo, label) - if (! hostinfo) return - t.is( hostinfo.https(), "https://bitbucket.org/111/222.git" + hash, label + " -> https" ) - t.is( hostinfo.browse(), "https://bitbucket.org/111/222" + (branch ? "/src/" + branch : ""), label + " -> browse" ) - t.is( hostinfo.docs(), "https://bitbucket.org/111/222" + (branch ? "/src/" + branch : "") + "#readme", label + " -> docs" ) - t.is( hostinfo.ssh(), "git@bitbucket.org:111/222.git" + hash, label + " -> ssh" ) - t.is( hostinfo.sshurl(), "git+ssh://git@bitbucket.org/111/222.git" + hash, label + " -> sshurl" ) - t.is( (""+hostinfo), "git+ssh://git@bitbucket.org/111/222.git" + hash, label + " -> stringify" ) - t.is( hostinfo.file("C"), "https://bitbucket.org/111/222/raw/"+(branch||"master")+"/C", label + " -> file" ) - } - - require('./lib/standard-tests')(verify, "bitbucket.org", "bitbucket") - - t.end() -}) - diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gist.js b/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gist.js deleted file mode 100644 index a316048cb..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gist.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict" -var HostedGit = require("../index") -var test = require("tap").test - - -test("fromUrl(gist url)", function (t) { - function verify(host, label, branch) { - var hostinfo = HostedGit.fromUrl(host) - var hash = branch ? "#" + branch : "" - t.ok(hostinfo, label) - if (! hostinfo) return - t.is( hostinfo.https(), "https://gist.github.com/222.git" + hash, label + " -> https" ) - t.is( hostinfo.git(), "git://gist.github.com/222.git" + hash, label + " -> git" ) - t.is( hostinfo.browse(), "https://gist.github.com/222" + (branch ? "/" + branch : ""), label + " -> browse" ) - t.is( hostinfo.bugs(), "https://gist.github.com/222", label + " -> bugs" ) - t.is( hostinfo.docs(), "https://gist.github.com/222" + (branch ? "/" + branch : ""), label + " -> docs" ) - t.is( hostinfo.ssh(), "git@gist.github.com:/222.git" + hash, label + " -> ssh" ) - t.is( hostinfo.sshurl(), "git+ssh://git@gist.github.com/222.git" + hash, label + " -> sshurl" ) - t.is( (""+hostinfo), "git+ssh://git@gist.github.com/222.git" + hash, label + " -> stringify" ) - if (hostinfo.user) { - t.is( hostinfo.file("C"), "https://gist.githubusercontent.com/111/222/raw/"+(branch?branch+"/":"")+"C", label + " -> file" ) - } - } - - verify("git@gist.github.com:222.git", "git@") - var hostinfo = HostedGit.fromUrl("git@gist.github.com:/ef860c7z5e0de3179341.git") - if (t.ok(hostinfo, "git@hex")) { - t.is( hostinfo.https(), "https://gist.github.com/ef860c7z5e0de3179341.git", "git@hex -> https" ) - } - verify("git@gist.github.com:/222.git", "git@/") - verify("git://gist.github.com/222", "git") - verify("git://gist.github.com/222.git", "git.git") - verify("git://gist.github.com/222#branch", "git#branch", "branch") - verify("git://gist.github.com/222.git#branch", "git.git#branch", "branch") - - require('./lib/standard-tests')(verify, "gist.github.com", "gist") - - t.end() -}) - diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/github.js b/node_modules/npm-package-arg/node_modules/hosted-git-info/test/github.js deleted file mode 100644 index e551c45d7..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/github.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict" -var HostedGit = require("../index") -var test = require("tap").test - - -test("fromUrl(github url)", function (t) { - function verify(host, label, branch) { - var hostinfo = HostedGit.fromUrl(host) - var hash = branch ? "#" + branch : "" - t.ok(hostinfo, label) - if (! hostinfo) return - t.is( hostinfo.https(), "https://github.com/111/222.git" + hash, label + " -> https" ) - t.is( hostinfo.git(), "git://github.com/111/222.git" + hash, label + " -> git" ) - t.is( hostinfo.browse(), "https://github.com/111/222" + (branch ? "/tree/" + branch : ""), label + " -> browse" ) - t.is( hostinfo.bugs(), "https://github.com/111/222/issues", label + " -> bugs" ) - t.is( hostinfo.docs(), "https://github.com/111/222" + (branch ? "/tree/" + branch : "") + "#readme", label + " -> docs" ) - t.is( hostinfo.ssh(), "git@github.com:111/222.git" + hash, label + " -> ssh" ) - t.is( hostinfo.sshurl(), "git+ssh://git@github.com/111/222.git" + hash, label + " -> sshurl" ) - t.is( (""+hostinfo), "git+ssh://git@github.com/111/222.git" + hash, label + " -> stringify" ) - t.is( hostinfo.file("C"), "https://raw.githubusercontent.com/111/222/"+(branch||"master")+"/C", label + " -> file" ) - } - - // github shorturls - verify("111/222", "github-short") - verify("111/222#branch", "github-short#branch", "branch") - - // insecure protocols - verify("git://github.com/111/222", "git") - verify("git://github.com/111/222.git", "git.git") - verify("git://github.com/111/222#branch", "git#branch", "branch") - verify("git://github.com/111/222.git#branch", "git.git#branch", "branch") - - verify("http://github.com/111/222", "http") - verify("http://github.com/111/222.git", "http.git") - verify("http://github.com/111/222#branch", "http#branch", "branch") - verify("http://github.com/111/222.git#branch", "http.git#branch", "branch") - - require('./lib/standard-tests')(verify, "github.com", "github") - - t.end() -}) - diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gitlab.js b/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gitlab.js deleted file mode 100644 index 1a4e07096..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gitlab.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict" -var HostedGit = require("../index") -var test = require("tap").test - - -test("fromUrl(gitlab url)", function (t) { - function verify(host, label, branch) { - var hostinfo = HostedGit.fromUrl(host) - var hash = branch ? "#" + branch : "" - t.ok(hostinfo, label) - if (! hostinfo) return - t.is( hostinfo.https(), "https://gitlab.com/111/222.git" + hash, label + " -> https" ) - t.is( hostinfo.browse(), "https://gitlab.com/111/222" + (branch ? "/tree/" + branch : ""), label + " -> browse" ) - t.is( hostinfo.docs(), "https://gitlab.com/111/222" + (branch ? "/tree/" + branch : "") + "#README", label + " -> docs" ) - t.is( hostinfo.ssh(), "git@gitlab.com:111/222.git" + hash, label + " -> ssh" ) - t.is( hostinfo.sshurl(), "git+ssh://git@gitlab.com/111/222.git" + hash, label + " -> sshurl" ) - t.is( (""+hostinfo), "git+ssh://git@gitlab.com/111/222.git" + hash, label + " -> stringify" ) - t.is( hostinfo.file("C"), "https://gitlab.com/111/222/raw/"+(branch||"master")+"/C", label + " -> file" ) - } - - require('./lib/standard-tests')(verify, "gitlab.com", "gitlab") - - t.end() -}) - diff --git a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/lib/standard-tests.js b/node_modules/npm-package-arg/node_modules/hosted-git-info/test/lib/standard-tests.js deleted file mode 100644 index c505342fa..000000000 --- a/node_modules/npm-package-arg/node_modules/hosted-git-info/test/lib/standard-tests.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict" -module.exports = function (verify, domain, shortname) { - verify("https://" + domain + "/111/222", "https") - verify("https://" + domain + "/111/222.git", "https.git") - verify("https://" + domain + "/111/222#branch", "https#branch", "branch") - verify("https://" + domain + "/111/222.git#branch", "https.git#branch", "branch") - - verify("git+https://" + domain + "/111/222", "git+https") - verify("git+https://" + domain + "/111/222.git", "git+https.git") - verify("git+https://" + domain + "/111/222#branch", "git+https#branch", "branch") - verify("git+https://" + domain + "/111/222.git#branch", "git+https.git#branch", "branch") - - verify("git@" + domain + ":111/222", "ssh") - verify("git@" + domain + ":111/222.git", "ssh.git") - verify("git@" + domain + ":111/222#branch", "ssh", "branch") - verify("git@" + domain + ":111/222.git#branch", "ssh.git", "branch") - - - verify("git+ssh://git@" + domain + "/111/222", "ssh url") - verify("git+ssh://git@" + domain + "/111/222.git", "ssh url.git") - verify("git+ssh://git@" + domain + "/111/222#branch", "ssh url#branch", "branch") - verify("git+ssh://git@" + domain + "/111/222.git#branch", "ssh url.git#branch", "branch") - - verify(shortname + ":111/222", "shortcut") - verify(shortname + ":111/222.git", "shortcut.git") - verify(shortname + ":111/222#branch", "shortcut#branch", "branch") - verify(shortname + ":111/222.git#branch", "shortcut.git#branch", "branch") -} |