Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TaskLib, PSR-3 logger, and interim DI container. #283

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ca618e8
Split off TaskLib from Robo\Tasks. Add a Dependency Injection contain…
greg-1-anderson Mar 5, 2016
c7f24ee
Fix quoting error in PackPhar.
greg-1-anderson Mar 7, 2016
cea3129
Create a task assembly step, and use it in all loadTasks. This allows…
greg-1-anderson Mar 7, 2016
084e165
Improve styling of simulator output.
greg-1-anderson Mar 7, 2016
3d59092
Fix Nitpick CI issues.
greg-1-anderson Mar 7, 2016
dcf1b03
Automatically exclude accessor methods from command list.
greg-1-anderson Mar 7, 2016
f0ae7e9
Use reverse styling instead of assuming the terminal colors.
greg-1-anderson Mar 7, 2016
dfff660
Switch to league/container for Dependency Injection.
greg-1-anderson Mar 10, 2016
d9c20af
Adjust whitespace for NitPick.
greg-1-anderson Mar 10, 2016
ec5d60f
Remove test code left in by accident.
greg-1-anderson Mar 11, 2016
4b3f964
Use ::class instead of strings when setting up DI container.
greg-1-anderson Mar 13, 2016
5f66ab3
Declare minimum php to be 5.5 now.
greg-1-anderson Mar 13, 2016
254c647
Don't test php 5.4.
greg-1-anderson Mar 13, 2016
009fcde
Remove all loadTask traits; fetch from our container instead.
greg-1-anderson Mar 14, 2016
269e6d0
Filter out accessor methods from command list.
greg-1-anderson Mar 14, 2016
40b1bf5
Fix spacing for NitPick.
greg-1-anderson Mar 15, 2016
ff7850b
Introdoce 'task' convenience function to make fetching task services …
greg-1-anderson Mar 15, 2016
eb0d5c7
Remove workaround in RoboContainer now that League/Container has been…
greg-1-anderson Mar 15, 2016
3990a7c
Simplify service providers with SimpleServiceProvider.php.
greg-1-anderson Mar 16, 2016
f7ef6dc
Fix NitPick style.
greg-1-anderson Mar 16, 2016
8e40124
Put back loadTasks traits.
greg-1-anderson Mar 16, 2016
729202a
Simplify CliHelper to just use Tasklib (with appropriate remaps to 'p…
greg-1-anderson Mar 16, 2016
8a014a8
Adjust spacing in Bower\loadTasks.
greg-1-anderson Mar 16, 2016
12b1255
Use __FUNCTION__ in loadTasks to ensure a strong corrolation between …
greg-1-anderson Mar 16, 2016
426cf5f
Restore RoboFile to previous version (resume use of loadTask shortcuts).
greg-1-anderson Mar 16, 2016
3ee6235
Be more consistent with container use for object initialization.
greg-1-anderson Mar 16, 2016
8388ce3
Formalize wrapped tasks.
greg-1-anderson Mar 16, 2016
cd4fbed
Do not wrap our wrappers. Do not unwrap the Simulator when adding to …
greg-1-anderson Mar 16, 2016
9e0c4b0
Ensure that logger is always configured for core Robo tasks. Emit a d…
greg-1-anderson Mar 16, 2016
bf25add
Use SimpleServiceProvider to register Collection services.
greg-1-anderson Mar 16, 2016
ac88ae9
SimpleServiceProvider does not need to be abstract.
greg-1-anderson Mar 16, 2016
9b31b4e
Move File ServiceProviders into loadTasks.
greg-1-anderson Mar 16, 2016
a1515f6
Move all of the ServiceProvider classes into loadTasks.
greg-1-anderson Mar 17, 2016
d141895
Fix a couple of style problems.
greg-1-anderson Mar 17, 2016
699d388
Use AbstractSignatureServiceProvider in SimpleServiceProvider so that…
greg-1-anderson Mar 17, 2016
cf079a1
Use league/container 2.2
greg-1-anderson Mar 17, 2016
ccda129
Merge pull request #284 from Codegyre/task-assembly
DavertMik Mar 19, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0
Expand Down
42 changes: 41 additions & 1 deletion RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,51 @@ public function tryInteractive()

public function tryError()
{
$result = $this->taskExec('ls xyzzy' . date('U'))->run();
$result = $this->taskExec('ls xyzzy' . date('U'))->dir('/tmp')->run();
}

public function trySuccess()
{
$result = $this->taskExec('pwd')->run();
}

public function tryDeprecated()
{
$result = (new \Robo\Task\Base\Exec('pwd'))->run();
}

public function tryTmpDir()
{
// Set up a collection to add tasks to
$collection = $this->collection();

// Get a temporary directory to work in. Note that we get a
// name back, but the directory is not created until the task
// runs. This technically is not thread-safe, but we create
// a random name, so it is unlikely to conflict.
$tmpPath = $this->taskTmpDir()
->addToCollection($collection)
->getPath();

// We can create the temporary directory early by running
// 'runWithoutCompletion()'. n.b. if we called 'run()' at
// this point, the collection's 'complete()' method would be
// called, and the temporary directory would be deleted.
$mktmpResult = $collection->runWithoutCompletion();

if (is_dir($tmpPath)) {
$this->say("Created a temporary directory at $tmpPath");
} else {
$this->say("Requested a temporary directory at $tmpPath, but it was not created");
}

// Run the task collection
$result = $collection->run();

if (is_dir($tmpPath)) {
$this->say("The temporary directory at $tmpPath was not cleaned up after the collection completed.");
} else {
$this->say("The temporary directory at $tmpPath was automatically deleted.");
}
}
}
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
},
"bin":["robo"],
"require": {
"php": ">=5.4.0",
"php": ">=5.5.0",
"consolidation/log": "~0",
"symfony/finder": "~2.5|~3.0",
"symfony/console": "~2.5|~3.0",
"symfony/process": "~2.5|~3.0",
"symfony/filesystem": "~2.5|~3.0"
"symfony/filesystem": "~2.5|~3.0",
"league/container": "~2.2"
},
"require-dev": {
"patchwork/jsqueeze": "~1.0",
Expand Down
Loading