now has .git

This commit is contained in:
Philipp Kunz 2016-02-23 08:48:41 +01:00
parent e4ef9bf97a
commit 3c9dd787b3
9 changed files with 25 additions and 16 deletions

View File

@ -8,10 +8,7 @@ var ProjectinfoNPM = (function () {
this.status = "ok";
this.license = this.packageJson.license;
if (this.packageJson.repository) {
this.repoUrl = this.packageJson.repository.url;
}
else {
this.repoUrl = undefined;
this.git = plugins.smartstring.git(this.packageJson.repository.url);
}
;
}
@ -19,4 +16,4 @@ var ProjectinfoNPM = (function () {
})();
module.exports = ProjectinfoNPM;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZvLm5wbS50cyJdLCJuYW1lcyI6WyJQcm9qZWN0aW5mb05QTSIsIlByb2plY3RpbmZvTlBNLmNvbnN0cnVjdG9yIl0sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsdUJBQXVCLENBQUMsQ0FBQztBQUNsRDtJQVFJQSx3QkFBWUEsTUFBYUE7UUFDckJDLElBQUlBLENBQUNBLFdBQVdBLEdBQUdBLE9BQU9BLENBQUNBLFNBQVNBLENBQUNBLGdCQUFnQkEsQ0FDakRBLE9BQU9BLENBQUNBLElBQUlBLENBQUNBLElBQUlBLENBQ2JBLE9BQU9BLENBQUNBLElBQUlBLENBQUNBLE9BQU9BLENBQUNBLE1BQU1BLENBQUNBLEVBQzVCQSxjQUFjQSxDQUNqQkEsQ0FDSkEsQ0FBQ0E7UUFDRkEsSUFBSUEsQ0FBQ0EsSUFBSUEsR0FBR0EsSUFBSUEsQ0FBQ0EsV0FBV0EsQ0FBQ0EsSUFBSUEsQ0FBQ0E7UUFDbENBLElBQUlBLENBQUNBLE9BQU9BLEdBQUdBLElBQUlBLENBQUNBLFdBQVdBLENBQUNBLE9BQU9BLENBQUNBO1FBQ3hDQSxJQUFJQSxDQUFDQSxNQUFNQSxHQUFHQSxJQUFJQSxDQUFDQTtRQU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AgICAgICAgICBwbHVnaW5zLnBhdGguam9pbihcbiAgICAgICAgICAgICAgICBwbHVnaW5zLnBhdGgucmVzb2x2ZShjd2RBcmcpLFxuICAgICAgICAgICAgICAgIFwicGFja2FnZS5qc29uXCJcbiAgICAgICAgICAgIClcbiAgICAgICAgKTtcbiAgICAgICAgdGhpcy5uYW1lID0gdGhpcy5wYWNrYWdlSnNvbi5uYW1lO1xuICAgICAgICB0aGlzLnZlcnNpb24gPSB0aGlzLnBhY2thZ2VKc29uLnZlcnNpb247XG4gICAgICAgIHRoaXMuc3RhdHVzID0gXCJva1wiO1xuICAgICAgICB0aGlzLmxpY2Vuc2UgPSB0aGlzLnBhY2thZ2VKc29uLmxpY2Vuc2U7XG4gICAgICAgIGlmICh0aGlzLnBhY2thZ2VKc29uLnJlcG9zaXRvcnkpe1xuICAgICAgICAgICAgdGhpcy5yZXBvVXJsID0gdGhpcy5wYWNrYWdlSnNvbi5yZXBvc2l0b3J5LnVybDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMucmVwb1VybCA9IHVuZGVmaW5lZDtcbiAgICAgICAgfTtcblxuXG4gICAgfVxufVxuXG5leHBvcnQgPSBQcm9qZWN0aW5mb05QTTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZvLm5wbS50cyJdLCJuYW1lcyI6WyJQcm9qZWN0aW5mb05QTSIsIlByb2plY3RpbmZvTlBNLmNvbnN0cnVjdG9yIl0sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsdUJBQXVCLENBQUMsQ0FBQztBQUNsRDtJQVFJQSx3QkFBWUEsTUFBYUE7UUFDckJDLElBQUlBLENBQUNBLFdBQVdBLEdBQUdBLE9BQU9BLENBQUNBLFNBQVNBLENBQUNBLGdCQUFnQkEsQ0FDakRB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vamVjdGluZm8ucGx1Z2luc1wiKTtcbmNsYXNzIFByb2plY3RpbmZvTlBNICB7XG4gICAgcGFja2FnZUpzb247XG4gICAgbmFtZTpzdHJpbmc7XG4gICAgdmVyc2lvbjpzdHJpbmc7XG4gICAgc3RhdHVzOnN0cmluZztcbiAgICBsaWNlbnNlOnN0cmluZztcbiAgICBnaXQ7XG5cbiAgICBjb25zdHJ1Y3Rvcihjd2RBcmc6c3RyaW5nKXtcbiAgICAgICAgdGhpcy5wYWNrYWdlSnNvbiA9IHBsdWdpbnMuc21hcnRmaWxlLnJlYWRGaWxlVG9PYmplY3QoXG4gICAgICAgICAgICBwbHVnaW5zLnBhdGguam9pbihcbiAgICAgICAgICAgICAgICBwbHVnaW5zLnBhdGgucmVzb2x2ZShjd2RBcmcpLFxuICAgICAgICAgICAgICAgIFwicGFja2FnZS5qc29uXCJcbiAgICAgICAgICAgIClcbiAgICAgICAgKTtcbiAgICAgICAgdGhpcy5uYW1lID0gdGhpcy5wYWNrYWdlSnNvbi5uYW1lO1xuICAgICAgICB0aGlzLnZlcnNpb24gPSB0aGlzLnBhY2thZ2VKc29uLnZlcnNpb247XG4gICAgICAgIHRoaXMuc3RhdHVzID0gXCJva1wiO1xuICAgICAgICB0aGlzLmxpY2Vuc2UgPSB0aGlzLnBhY2thZ2VKc29uLmxpY2Vuc2U7XG4gICAgICAgIGlmICh0aGlzLnBhY2thZ2VKc29uLnJlcG9zaXRvcnkpe1xuICAgICAgICAgICAgdGhpcy5naXQgPSBwbHVnaW5zLnNtYXJ0c3RyaW5nLmdpdCh0aGlzLnBhY2thZ2VKc29uLnJlcG9zaXRvcnkudXJsKTtcbiAgICAgICAgfTtcblxuICAgIH1cbn1cblxuZXhwb3J0ID0gUHJvamVjdGluZm9OUE07Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9

View File

@ -2,8 +2,9 @@
var plugins = {
path: require("path"),
Q: require("q"),
smartfile: require("smartfile")
smartfile: require("smartfile"),
smartstring: require("smartstring")
};
module.exports = plugins;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZvLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDO0FBQzVDLElBQUksT0FBTyxHQUFHO0lBQ1YsSUFBSSxFQUFFLE9BQU8sQ0FBQyxNQUFNLENBQUM7SUFDckIsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUM7SUFDZixTQUFTLEVBQUUsT0FBTyxDQUFDLFdBQVcsQ0FBQztDQUNsQyxDQUFDO0FBRUYsaUJBQVMsT0FBTyxDQUFDIiwiZmlsZSI6InByb2plY3RpbmZvLnBsdWdpbnMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG52YXIgcGx1Z2lucyA9IHtcbiAgICBwYXRoOiByZXF1aXJlKFwicGF0aFwiKSxcbiAgICBROiByZXF1aXJlKFwicVwiKSxcbiAgICBzbWFydGZpbGU6IHJlcXVpcmUoXCJzbWFydGZpbGVcIilcbn07XG5cbmV4cG9ydCA9IHBsdWdpbnM7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZvLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDO0FBQzVDLElBQUksT0FBTyxHQUFHO0lBQ1YsSUFBSSxFQUFFLE9BQU8sQ0FBQyxNQUFNLENBQUM7SUFDckIsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUM7SUFDZixTQUFTLEVBQUUsT0FBTyxDQUFDLFdBQVcsQ0FBQztJQUMvQixXQUFXLEVBQUUsT0FBTyxDQUFDLGFBQWEsQ0FBQztDQUN0QyxDQUFDO0FBRUYsaUJBQVMsT0FBTyxDQUFDIiwiZmlsZSI6InByb2plY3RpbmZvLnBsdWdpbnMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG52YXIgcGx1Z2lucyA9IHtcbiAgICBwYXRoOiByZXF1aXJlKFwicGF0aFwiKSxcbiAgICBROiByZXF1aXJlKFwicVwiKSxcbiAgICBzbWFydGZpbGU6IHJlcXVpcmUoXCJzbWFydGZpbGVcIiksXG4gICAgc21hcnRzdHJpbmc6IHJlcXVpcmUoXCJzbWFydHN0cmluZ1wiKVxufTtcblxuZXhwb3J0ID0gcGx1Z2luczsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

View File

@ -29,6 +29,7 @@
},
"dependencies": {
"q": "^1.4.1",
"smartfile": "0.0.11"
"smartfile": "0.0.11",
"smartstring": "0.0.2"
}
}

View File

@ -2,6 +2,10 @@
"name": "testpackage",
"version": "1.0.0",
"description": "some test",
"repository": {
"type": "git",
"url": "git+https://github.com/someuser/somerepo.git"
},
"main": "test.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"

View File

@ -24,6 +24,10 @@ describe("projectinfo", function () {
myNpm
.should.have.property("license", "MIT");
});
it("should have .git", function () {
myNpm.git.httpsUrl
.should.equal("https://github.com/someuser/somerepo.git");
});
});
describe(".getName()", function () {
it("should return a name", function () {
@ -33,4 +37,4 @@ describe("projectinfo", function () {
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksV0FBVyxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0FBQzlDLElBQUksTUFBTSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztBQ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thZ2VcIik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGl0KFwic2hvdWxkIGhhdmUgLnZlcnNpb25cIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG1cbiAgICAgICAgICAgICAgICAuc2hvdWxkLmhhdmUucHJvcGVydHkoXCJ2ZXJzaW9uXCIsXCIxLjAuMFwiKVxuICAgICAgICB9KTtcblxuICAgICAgICBpdChcInNob3VsZCBoYXZlIC5uYW1lXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIG15TnBtXG4gICAgICAgICAgICAgICAgLnNob3VsZC5oYXZlLnByb3BlcnR5KFwibmFtZVwiLFwidGVzdHBhY2thZ2VcIik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGl0KFwic2hvdWxkIGhhdmUgLmxpY2Vuc2VcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG1cbiAgICAgICAgICAgICAgICAuc2hvdWxkLmhhdmUucHJvcGVydHkoXCJsaWNlbnNlXCIsXCJNSVRcIik7XG4gICAgICAgIH0pO1xuXG4gICAgfSk7XG5cbiAgICBkZXNjcmliZShcIi5nZXROYW1lKClcIixmdW5jdGlvbigpe1xuICAgICAgICBpdChcInNob3VsZCByZXR1cm4gYSBuYW1lXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIHByb2plY3RpbmZvLmdldE5hbWUodGVzdEJhc2VQYXRoKVxuICAgICAgICAgICAgICAgIC5zaG91bGQuZXF1YWwoXCJ0ZXN0cGFja2FnZVwiKTtcbiAgICAgICAgfSk7XG4gICAgfSlcbn0pOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksV0FBVyxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQ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AAK;iBACA,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAC,OAAO,CAAC,CAAA;QAChD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mBAAmB,EAAC;YACnB,KAAK;iBACA,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAC,aAAa,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sBAAsB,EAAC;YACtB,KAAK;iBACA,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAC,KAAK,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,kBAAkB,EAAC;YAClB,KAAK,CAAC,GAAG,CAAC,QAAQ;iBACb,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IAEP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,YAAY,EAAC;QAClB,EAAE,CAAC,sBAAsB,EAAC;YACtB,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC;iBAC5B,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAC"}

View File

@ -28,6 +28,10 @@ describe("projectinfo",function(){
myNpm
.should.have.property("license","MIT");
});
it("should have .git",function(){
myNpm.git.httpsUrl
.should.equal("https://github.com/someuser/somerepo.git");
});
});

View File

@ -6,7 +6,7 @@ class ProjectinfoNPM {
version:string;
status:string;
license:string;
repoUrl:string;
git;
constructor(cwdArg:string){
this.packageJson = plugins.smartfile.readFileToObject(
@ -20,12 +20,9 @@ class ProjectinfoNPM {
this.status = "ok";
this.license = this.packageJson.license;
if (this.packageJson.repository){
this.repoUrl = this.packageJson.repository.url;
} else {
this.repoUrl = undefined;
this.git = plugins.smartstring.git(this.packageJson.repository.url);
};
}
}

View File

@ -2,7 +2,8 @@
var plugins = {
path: require("path"),
Q: require("q"),
smartfile: require("smartfile")
smartfile: require("smartfile"),
smartstring: require("smartstring")
};
export = plugins;