Skip to content

Commit

Permalink
updated documentation task
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed Apr 26, 2014
1 parent 6966c37 commit 415fee7
Show file tree
Hide file tree
Showing 4 changed files with 311 additions and 169 deletions.
17 changes: 12 additions & 5 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public function versionBump($version = null)
->run();
}

// publish docs
/**
* generate docs
*/
public function docs()
{
$docs = [];
Expand All @@ -72,10 +74,15 @@ public function docs()
$taskGenerator->filterMethods(function(\ReflectionMethod $m) {
if ($m->isConstructor() or $m->isDestructor()) return false;
return $m->name != 'run' and $m->name != '__call' and $m->isPublic(); // methods are not documented
})->processMethod(function (\ReflectionMethod $m, $text) {
return "* " . $m->name . '('.implode(', ', $m->getParameters()).")\n";
})->processClassSignature(function($c) {
return "## {$c->name}\n";
})->processClassDocBlock(function($c, $doc) {
return str_replace('@method \\'.$c->name, '* ', $doc);
})->processMethodSignature(function (\ReflectionMethod $m, $text) {
return str_replace('#### *public* ', '* ', $text);
})->processMethodDocBlock(function() {
return "";
})->processClass(function(\ReflectionClass $refl, $text) {
$text = str_replace("@method ".$refl->getShortName(),'*',$text);
if ($refl->isTrait()) {
return "## ".$refl->getShortName()."\n\n``` use ".$refl->getName().";```\n$text";
} else {
Expand Down Expand Up @@ -122,7 +129,7 @@ public function watch()
*/
public function para()
{
$this->parallelExec()
$this->taskParallelExec()
->process('php ~/demos/robotests/parascript.php hey')
->process('php ~/demos/robotests/parascript.php hoy')
->process('php ~/demos/robotests/parascript.php gou')
Expand Down
Loading

0 comments on commit 415fee7

Please sign in to comment.