From eb50d2e53613a15e28d45c54566de9880ab673c8 Mon Sep 17 00:00:00 2001 From: marco Date: Mon, 20 Jul 2015 18:02:40 +0200 Subject: [PATCH] Watch command. --- README.md | 39 ++++++++------------------------------- RoboFile.php | 6 +++++- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 83b4c87e7d..fcdcccd7ff 100644 --- a/README.md +++ b/README.md @@ -10,33 +10,20 @@ Not another MP2 a.k.a MP3 done the right way. # Install. - Clone the repo in wp-content/plugins. -- Install PHP (OSX comes with it). -- Install NodeJS. +- Install system dependencies: +PHP, NodeJS, PhantomJS. - Install composer. ```sh $ curl -sS https://getcomposer.org/installer | php $ php composer.phar install ``` -- Install dependencies. +- Install PHP dependencies. ```sh $ php composer.phar install ``` -- Instal NPM +- Instal JS dependencies ```sh -$ npm install npm -g -``` -- Install Bower -``` -$ npm install bower -g -``` -- Install Stylus -```sh -$ npm install stylus -g -``` -- Install Nib (Stylus extension) -```sh -$ npm install nib -g -``` +$ npm install # Structure. @@ -67,21 +54,11 @@ Kickstart file. Unit tests are in /tests/unit. You can just duplicate a Cest file and start testing. Methods available for testing come from Verify: https://github.com/Codeception/Verify ``` -$ vendor/bin/codecept run +$ ./do test:unit ``` # Acceptance testing. -- Install PhantomJS: -``` -$ brew|aptitude install phantomjs -``` - -- Run PhantomJS: -``` -$ phantomjs --webdriver=4444 -``` - - Run a WordPress install at: ``` 127.0.0.1:8888 @@ -89,8 +66,8 @@ $ phantomjs --webdriver=4444 - Run tests: ``` -$ vendor/bin/codecept run +$ ./do tes:acceptance ``` # Stylus command -stylus -u nib -w assets/css/src/admin.styl -o assets/css/ \ No newline at end of file +stylus -u nib -w assets/css/src/admin.styl -o assets/css/ diff --git a/RoboFile.php b/RoboFile.php index bd409aa613..0a5dc6b18e 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -19,10 +19,14 @@ class RoboFile extends \Robo\Tasks { function testAll() { $this - ->taskExec('phantomjs --webdriver=4444') + ->taskexec('phantomjs --webdriver=4444') ->background() ->run(); sleep(2); $this->_exec('vendor/bin/codecept run'); } + + function watch() { + $this->_exec('./node_modules/stylus/bin/stylus -u nib -w assets/css/src/admin.styl -o assets/css/'); + } }