diff --git a/.gitignore b/.gitignore index 67c4323..e10c99a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ Icon? .svn nbproject Thumbs.db -*.komodoproject \ No newline at end of file +*.komodoproject +composer.lock +vendor/* +koharness_bootstrap.php diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1313e37 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +language: php + +php: + - 5.3 + - 5.4 + - 5.5 + - 5.6 + - hhvm + +before_script: + - composer install --prefer-dist + - vendor/bin/koharness + +script: + - cd /tmp/koharness && ./vendor/bin/phpunit --bootstrap=modules/unittest/bootstrap.php modules/unittest/tests.php + +notifications: + email: false diff --git a/README.md b/README.md index 6d317cb..15c6525 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Minion +| ver | Stable | Develop | +|-------|----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------| +| 3.3.x | [![Build Status - 3.3/master](https://travis-ci.org/kohana/minion.svg?branch=3.3%2Fmaster)](https://travis-ci.org/kohana/minion) | [![Build Status - 3.3/develop](https://travis-ci.org/kohana/minion.svg?branch=3.3%2Fdevelop)](https://travis-ci.org/kohana/minion) | +| 3.4.x | [![Build Status - 3.4/master](https://travis-ci.org/kohana/minion.svg?branch=3.4%2Fmaster)](https://travis-ci.org/kohana/minion) | [![Build Status - 3.4/develop](https://travis-ci.org/kohana/minion.svg?branch=3.4%2Fdevelop)](https://travis-ci.org/kohana/minion) | + Minion is a framework for running tasks via the CLI. The system is inspired by ruckusing, which had a nice system for defining tasks but lacked the desired flexibility for kohana integration. diff --git a/classes/Kohana/Minion/CLI.php b/classes/Kohana/Minion/CLI.php index 13c1de6..5726b16 100644 --- a/classes/Kohana/Minion/CLI.php +++ b/classes/Kohana/Minion/CLI.php @@ -170,7 +170,7 @@ public static function password($text = '') // Create temporary file file_put_contents($vbscript, 'wscript.echo(InputBox("'.addslashes($text).'"))'); - $password = shell_exec('cscript //nologo '.escapeshellarg($command)); + $password = shell_exec('cscript //nologo '.escapeshellarg($vbscript)); // Remove temporary file. unlink($vbscript); diff --git a/classes/Kohana/Minion/Exception.php b/classes/Kohana/Minion/Exception.php index 735dac4..887fbc7 100644 --- a/classes/Kohana/Minion/Exception.php +++ b/classes/Kohana/Minion/Exception.php @@ -15,8 +15,6 @@ class Kohana_Minion_Exception extends Kohana_Exception { * * Should this display a stack trace? It's useful. * - * Should this still log? Maybe not as useful since we'll see the error on the screen. - * * @uses Kohana_Exception::text * @param Exception $e * @return boolean @@ -25,6 +23,9 @@ public static function handler(Exception $e) { try { + // Log the exception + Kohana_Exception::log($e); + if ($e instanceof Minion_Exception) { echo $e->format_for_cli(); diff --git a/classes/Kohana/Minion/Task.php b/classes/Kohana/Minion/Task.php index be4fcc0..36c5ac7 100644 --- a/classes/Kohana/Minion/Task.php +++ b/classes/Kohana/Minion/Task.php @@ -206,7 +206,7 @@ public function get_accepted_options() public function build_validation(Validation $validation) { // Add a rule to each key making sure it's in the task - foreach ($validation->as_array() as $key => $value) + foreach ($validation->data() as $key => $value) { $validation->rule($key, array($this, 'valid_option'), array(':validation', ':field')); } diff --git a/composer.json b/composer.json index af7e9a0..a32e30b 100644 --- a/composer.json +++ b/composer.json @@ -24,10 +24,18 @@ "kohana/core": ">=3.3", "php": ">=5.3.3" }, + "require-dev": { + "kohana/core": "3.3.*@dev", + "kohana/unittest": "3.3.*@dev", + "kohana/koharness": "*@dev" + }, "extra": { "branch-alias": { "dev-3.3/develop": "3.3.x-dev", "dev-3.4/develop": "3.4.x-dev" - } + }, + "installer-paths": { + "vendor/{$vendor}/{$name}": ["type:kohana-module"] + } } } diff --git a/guide/minion/tasks.md b/guide/minion/tasks.md index 4bc6ddf..0923892 100644 --- a/guide/minion/tasks.md +++ b/guide/minion/tasks.md @@ -7,7 +7,7 @@ Writing a task in minion is very easy. Simply create a new class called `Task_ 'bar', 'bar' => NULL, ); @@ -68,4 +68,4 @@ Tasks can have built-in help. Minion will read class docblocks that you specify: */ class Minion_Task_Demo extends Minion_Task -The `@` tags in the class comments will also be displayed in a human readable format. When writing your task comments, you should specify how to use it, and any parameters it accepts. \ No newline at end of file +The `@` tags in the class comments will also be displayed in a human readable format. When writing your task comments, you should specify how to use it, and any parameters it accepts. diff --git a/koharness.php b/koharness.php new file mode 100644 index 0000000..fa0ed4d --- /dev/null +++ b/koharness.php @@ -0,0 +1,8 @@ + array( + 'minion' => __DIR__, + 'unittest' => __DIR__ . '/vendor/kohana/unittest' + ), +);