Пример #1
0
 public function testParsePath()
 {
     $this->object->parsePath(__DIR__ . '/big-git-log.txt');
     $this->object->getHistory()->setProject('hiqdev/chkipper');
     $renderer = new MarkdownRenderer();
     $text = $renderer->render($this->object->getHistory());
     $this->assertEquals(file_get_contents(__DIR__ . '/big-git-log.md'), $text);
 }
Пример #2
0
 public function actionIndex($version = null)
 {
     $historyFile = Yii::$app->config->historyFile;
     $changelogFile = Yii::$app->config->changelogFile;
     $parser = new MarkdownParser();
     $history = $parser->parsePath($historyFile);
     $gitlog = new GitLogParser();
     $gitlog->parseGitLog();
     $history->merge($gitlog->getHistory(), true);
     $history->normalize();
     if ($version) {
         if ($version === 'dev') {
             $version = $history->lastTag;
         }
         $history->setFirstTag($version);
     }
     $historyRenderer = new MarkdownRenderer();
     $changelogRenderer = new ChangelogMarkdownRenderer();
     File::write($historyFile, $historyRenderer->render($history));
     File::write($changelogFile, $changelogRenderer->render($history));
 }