當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Project.Project類代碼示例

本文整理匯總了TypeScript中@atomist/rug/model/Project.Project的典型用法代碼示例。如果您正苦於以下問題:TypeScript Project類的具體用法?TypeScript Project怎麽用?TypeScript Project使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Project類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: cleanChangeLog

export function cleanChangeLog(project: Project, owner: string): void {
    const changeLog: File = project.findFile("CHANGELOG.md");
    const middleContentRE = "\\d+\\.\\d+\\.\\d+\\.\\.\\.HEAD\n\n[\\S\\s]*## \\[0\\.1\\.0\\]";
    changeLog.regexpReplace(middleContentRE, "0.1.0...HEAD\n\n## [0.1.0]");
    changeLog.regexpReplace("\n### Added[\\S\\s]*", "\nAdded\n\n-   Everything\n");
    changeLog.replace("spring-rugs", project.name);
    changeLog.replace("atomist-rugs", owner);
}
開發者ID:atomist-attic,項目名稱:spring-rugs,代碼行數:8,代碼來源:RugGeneratorFunctions.ts

示例2: cleanReadMe

export function cleanReadMe(project: Project, description: string, owner: string): void {
    const readMe: File = project.findFile("README.md");
    readMe.regexpReplace("^# Atomist 'spring-rugs'[\\S\\s]*\n## Spring Boot REST Service\n",
        `# ${project.name}

This project contains a [Spring Boot][boot] [REST][rest] service for ${description}.
`);
}
開發者ID:atomist-attic,項目名稱:spring-rugs,代碼行數:8,代碼來源:RugGeneratorFunctions.ts

示例3: renameClass

export function renameClass(project: Project, oldClass: string, newClass: string): void {
    const eng: PathExpressionEngine = project.context.pathExpressionEngine;
    eng.with<JavaType>(project, `//JavaType()`, j => {
        if (j.name.indexOf(oldClass) >= 0) {
            j.renameByReplace(oldClass, newClass);
        }
    });
    project.replace(oldClass, newClass);
}
開發者ID:atomist-attic,項目名稱:spring-rugs,代碼行數:9,代碼來源:RugGeneratorFunctions.ts

示例4: Then

Then("file at ([^\\s]+) should not exist", (p: Project, world: ProjectScenarioWorld, path: string) => {
    return !p.fileExists(path);
});
開發者ID:atomist-attic,項目名稱:spring-rugs,代碼行數:3,代碼來源:NewSpringBootRestMicroserviceProjectSteps.ts

示例5:

toDelete.forEach(f => project.deleteFile(f));
開發者ID:atomist-attic,項目名稱:spring-rugs,代碼行數:1,代碼來源:RugGeneratorFunctions.ts


注:本文中的@atomist/rug/model/Project.Project類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。