Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed Jul 14, 2015
1 parent a668fde commit 994d877
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 8 deletions.
29 changes: 29 additions & 0 deletions docs/tasks/Assets.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
# Assets Tasks
## Less


Compiles less files.

```php
<?php
$this->taskLess([
'less/default.less' => 'css/default.css'
])
->run();
?>
```

Use one of both less compilers in your project:

```
"leafo/lessphp": "~0.5",
"oyejorge/less.php": "~1.5"
```

You can implement additional compilers by extending this task and adding a
method named after them and overloading the lessCompilers() method to
inject the name there.

* `compiler($compiler, array $options = Array ( ) )` Sets the less compiler.

## Minify

Expand All @@ -21,5 +47,8 @@ Please install additional dependencies to use:

* `to($dst)` Sets destination. Tries to guess type from it.
* `type($type)` Sets type with validation.
* `singleLine($singleLine)` Single line option for the JS minimisation.
* `keepImportantComments($keepImportantComments)` keepImportantComments option for the JS minimisation.
* `specialVarRx($specialVarRx)` specialVarRx option for the JS minimisation.
* `__toString()` @return string

1 change: 1 addition & 0 deletions docs/tasks/Base.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if ($this->taskExec('phpunit .')->run()->wasSuccessful()) {
#### *public static* instances* `background()` Executes command in background mode (asynchronously)
* `timeout($timeout)` Stop command if it runs longer then $timeout in seconds
* `idleTimeout($timeout)` Stops command if it does not output something for a while
* `env(array $env)` Sets the environment variables for the command
* `dir($dir)` changes working directory of command
* `printed($arg)` Should command output be printed
* `arg($arg)` Pass argument to executable
Expand Down
7 changes: 4 additions & 3 deletions docs/tasks/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,17 @@ Runs PHP server and stops it when task finishes.
``` php
<?php
// run server in /public directory
$this->taskPhpServer(8000)
$this->taskServer(8000)
->dir('public')
->run();

// run with IP 0.0.0.0
$this->taskPhpServer(8000)
$this->taskServer(8000)
->host('0.0.0.0')
->run();

// execute server in background
$this->taskPhpServer(8000)
$this->taskServer(8000)
->background()
->run();
?>
Expand All @@ -187,6 +187,7 @@ $this->taskPhpServer(8000)
* `background()` Executes command in background mode (asynchronously)
* `timeout($timeout)` Stop command if it runs longer then $timeout in seconds
* `idleTimeout($timeout)` Stops command if it does not output something for a while
* `env(array $env)` Sets the environment variables for the command
* `printed($arg)` Should command output be printed
* `arg($arg)` Pass argument to executable
* `args($args)` Pass methods parameters as arguments to executable
Expand Down
11 changes: 8 additions & 3 deletions docs/tasks/File.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@ $this->taskReplaceInFile('config.yml')
->regex('~^service:~')
->to('services:')
->run();

$this->taskReplaceInFile('box/robo.txt')
->from(array('##dbname##', '##dbhost##'))
->to(array('robo', 'localhost'))
->run();
?>
```

* `regex(string)` regex to match string to be replaced
* `from(string)` string to be replaced
* `to(string)` value to be set as a replacement
* `from(string|array)` string(s) to be replaced
* `to(string|array)` value(s) to be set as a replacement



Expand All @@ -68,7 +73,7 @@ $this->taskWriteToFile('blogpost.md')
* `lines(array $lines)` add more lines
* `text($text)` add a text
* `textFromFile($filename)` add a text from a file
* `place($name, $val)` substitute a placeholder with value, placeholder must be enclosed by {{}}
* `place($name, $val)` substitute a placeholder with value, placeholder must be enclosed by `{}`
* `replace($string, $replacement)` replace any string with value
* `regexReplace($pattern, $replacement)` replace any string with value using regular expression

2 changes: 1 addition & 1 deletion docs/tasks/FileSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $this->_copyDir('dist/config', 'config');
?>
```


* `dirPermissions($value)` Sets the default folder permissions for the destination if it doesn't exist

## DeleteDir

Expand Down
2 changes: 2 additions & 0 deletions docs/tasks/Remote.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ $this->taskRsync()
->toHost('localhost')
->toUser('dev')
->toPath('/var/www/html/app/')
->remoteShell('ssh -i public_key')
->recursive()
->excludeVcs()
->checksum()
Expand Down Expand Up @@ -66,6 +67,7 @@ if ('y' === $this->ask('Do you want to run (y/n)')) {
* `exclude($pattern)`
* `excludeFrom($file)`
* `filesFrom($file)`
* `remoteShell($command)`
* `dir($dir)` changes working directory of command
* `printed($arg)` Should command output be printed
* `arg($arg)` Pass argument to executable
Expand Down
3 changes: 2 additions & 1 deletion docs/tasks/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ $this->taskPHPUnit()
* `group($group)`
* `excludeGroup($group)`
* `json($file = null)` adds `log-json` option to runner
* `xml($file = null)` adds `log-xml` option
* `xml($file = null)` adds `log-junit` option
* `tap($file = null)`
* `bootstrap($file)`
* `configFile($file)`
* `debug()`
* `files($files)` Test files to run.
* `dir($dir)` changes working directory of command
* `printed($arg)` Should command output be printed
* `arg($arg)` Pass argument to executable
Expand Down
3 changes: 3 additions & 0 deletions docs/tasks/Vcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ $this->taskGitStack()
->add('-A')
->commit('adding everything')
->push('origin','master')
->tag('0.6.0')
->push('origin','0.6.0')
->run()

$this->taskGitStack()
Expand All @@ -29,6 +31,7 @@ $this->taskGitStack()
* `push($origin = null, $branch = null)` Executes `git push` command
* `merge($branch)` Performs git merge
* `checkout($branch)` Executes `git checkout` command
* `tag($tag_name)` Executes `git tag` command
* `exec($command)`
* `dir($dir)` changes working directory of command
* `printed($arg)` Should command output be printed
Expand Down

0 comments on commit 994d877

Please sign in to comment.