Skip to content

Commit

Permalink
Convert Bob Tasks to Bob TaskLibrary, fixes #38
Browse files Browse the repository at this point in the history
  • Loading branch information
CHH committed Jan 17, 2013
1 parent 8277c9e commit 9021132
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 33 deletions.
30 changes: 0 additions & 30 deletions bob/pipe_tasks.php

This file was deleted.

2 changes: 2 additions & 0 deletions bob_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Bob\BuildConfig;

register(new \Pipe\Bob\PipeTaskLibrary);

task('default', array('test'));

task('test', array('phpunit.xml'), function() {
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
"monolog/monolog": "~1.0"
},
"suggest": {
"react/http": "Enable the standalone asset server",
"react/http": "Enable the standalone asset server (~0.2.0)",
"symfony/http-foundation": "Enable dynamic asset serving with Pipe\\Server",
"imagine/imagine": "Enable image compressors"
},
"require-dev": {
"react/http": "~0.2",
"react/http": "~0.2.0",
"symfony/http-foundation": "~2.1",
"imagine/imagine": "~0.4",
"mikey179/vfsStream": "~1.1",
"chh/bob": "*@dev"
"chh/bob": "1.0.*@dev"
},
"autoload": {
"psr-0": {
Expand Down
30 changes: 30 additions & 0 deletions lib/Pipe/Bob/PipeTaskLibrary.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Pipe\Bob;

use Bob\TaskLibraryInterface;
use Bob\Application;
use Bob\BuildConfig as b;

class PipeTaskLibrary implements TaskLibraryInterface
{
function register(Application $app)
{
$app['pipe.environment'] = $app->share(function() use ($app) {
return new Environment;
});
}

function boot(Application $app)
{
$app->task('pipe:precompile', function() use ($app) {
$targetDirectory = $app['pipe.precompile_directory'];
$assets = (array) $app['pipe.precompile'];

$manifest = new Manifest($app['pipe.environment'], "$targetDirectory/manifest.json", $targetDirectory);
$manifest->setLogger($app['log']);
$manifest->compile($assets);
})->description = "Precompile assets";
}
}

0 comments on commit 9021132

Please sign in to comment.