Skip to content

Commit

Permalink
Merge pull request consolidation#316 from Codegyre/process-hook
Browse files Browse the repository at this point in the history
Process collections/tasks returned from commands
  • Loading branch information
DavertMik committed Apr 6, 2016
2 parents 37a037b + 739c6e8 commit 4c68d31
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 67 deletions.
34 changes: 14 additions & 20 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class RoboFile extends \Robo\Tasks
public function test($args = "")
{
return $this->taskCodecept()
->args($args)
->run();
->args($args);
}

/**
Expand Down Expand Up @@ -83,8 +82,7 @@ public function changed($addition)
{
return $this->taskChangelog()
->version(\Robo\Runner::VERSION)
->change($addition)
->run();
->change($addition);
}

/**
Expand All @@ -102,8 +100,7 @@ public function versionBump($version = '')
}
return $this->taskReplaceInFile(__DIR__.'/src/Runner.php')
->from("VERSION = '".\Robo\Runner::VERSION."'")
->to("VERSION = '".$version."'")
->run();
->to("VERSION = '".$version."'");
}

/**
Expand Down Expand Up @@ -171,7 +168,7 @@ function (\ReflectionMethod $m, $text) {
)->addToCollection($collection);
}
$collection->progressMessage('Documentation generation complete.');
return $collection->run();
return $collection;
}

/**
Expand Down Expand Up @@ -199,7 +196,7 @@ public function publish()
->addAsCompletion($collection);
$this->taskExec('mkdocs gh-deploy')
->addToCollection($collection);
return $collection->run();
return $collection;
}

/**
Expand Down Expand Up @@ -239,7 +236,7 @@ public function pharBuild()
->printed(false)
->addToCollection($collection);

return $collection->run();
return $collection;
}

/**
Expand All @@ -251,8 +248,7 @@ public function pharInstall()
{
return $this->taskExec('sudo cp')
->arg('robo.phar')
->arg('/usr/bin/robo')
->run();
->arg('/usr/bin/robo');
}

/**
Expand Down Expand Up @@ -327,7 +323,7 @@ public function tryPara($options = ['printed' => false, 'error' => false])
if ($options['error']) {
$para->process("ls $dir/tests/_data/filenotfound");
}
return $para->run();
return $para;
}

/**
Expand Down Expand Up @@ -370,8 +366,7 @@ public function tryServer()
{
return $this->taskServer(8000)
->dir('site')
->arg('site/index.php')
->run();
->arg('site/index.php');
}

/**
Expand All @@ -382,24 +377,23 @@ public function tryOpenBrowser()
return $this->taskOpenBrowser([
'http://robo.li',
'https://github.com/Codegyre/Robo'
])
->run();
]);
}

/**
* Demonstrate Robo error output and command failure.
*/
public function tryError()
{
return $this->taskExec('ls xyzzy' . date('U'))->dir('/tmp')->run();
return $this->taskExec('ls xyzzy' . date('U'))->dir('/tmp');
}

/**
* Demonstrate Robo standard output and command success.
*/
public function trySuccess()
{
return $this->taskExec('pwd')->run();
return $this->taskExec('pwd');
}

/**
Expand All @@ -414,7 +408,7 @@ public function tryDeprecated()
// Calling 'new' directly without manually setting
// up dependencies will result in a deprecation warning.
// @see RoboFile::trySuccess()
return (new \Robo\Task\Base\Exec('pwd'))->run();
return new \Robo\Task\Base\Exec('pwd');
}

/**
Expand Down Expand Up @@ -535,6 +529,6 @@ public function generateTask($className, $wrapperClassName = "")
$template = file_get_contents(__DIR__ . "/GeneratedWrapper.tmpl");
$template = str_replace(array_keys($replacements), array_values($replacements), $template);

print $template;
return $template;
}
}
91 changes: 46 additions & 45 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4c68d31

Please sign in to comment.