Use sensiolabs/ansi-to-html to parse the build logs.

Added an AnsiConverter helper.

Use the AnsiConverter in the email and page templates that display the build log.

Use a dedicated stylesheet for the ANSI converter.

It can be customized.
It can be inlined in the notifications.

Do not use ProphecyTestCase when not needed.
This commit is contained in:
Adirelle 2015-02-26 15:57:45 +01:00 committed by Tobias van Beek
commit df5e378b8a
9 changed files with 162 additions and 9 deletions

View file

@ -13,6 +13,7 @@ use b8;
use b8\Exception\HttpException\NotFoundException;
use b8\Http\Response\JsonResponse;
use PHPCI\BuildFactory;
use PHPCI\Helper\AnsiConverter;
use PHPCI\Helper\Lang;
use PHPCI\Model\Build;
use PHPCI\Model\Project;
@ -198,11 +199,7 @@ class BuildController extends \PHPCI\Controller
*/
protected function cleanLog($log)
{
$log = str_replace('[0;32m', '<span style="color: green">', $log);
$log = str_replace('[0;31m', '<span style="color: red">', $log);
$log = str_replace('[0m', '</span>', $log);
return $log;
return AnsiConverter::convert($log);
}
/**