本文整理汇总了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);
}
示例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}.
`);
}
示例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);
}
示例4: Then
Then("file at ([^\\s]+) should not exist", (p: Project, world: ProjectScenarioWorld, path: string) => {
return !p.fileExists(path);
});
示例5:
toDelete.forEach(f => project.deleteFile(f));