Skip to content

Commit

Permalink
rename to console-diff-renderer (#3)
Browse files Browse the repository at this point in the history
* rename to console-diff-renderer

* update asciicinema and make build
  • Loading branch information
Harry Bragg authored Jun 15, 2017
1 parent a4afb16 commit d2ff2cc
Show file tree
Hide file tree
Showing 24 changed files with 131 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ script:
- vendor/bin/phpunit --coverage-clover=./tests/report/coverage.clover

after_script:
- test -f ./tests/report/coverage.clover && (wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover ./tests/report/coverage.clover)
- test -f ./tests/report/coverage.clover && (wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover ./tests/report/coverage.clover)
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Contributions are **welcome**!

We accept contributions via Pull Requests on [Github](https://github.com/graze/buffered-console). We also recommend reading [How to write the perfect Pull Request](https://github.com/blog/1943-how-to-write-the-perfect-pull-request) which has some great tips and advice.
We accept contributions via Pull Requests on [Github](https://github.com/graze/console-diff-renderer). We also recommend reading [How to write the perfect Pull Request](https://github.com/blog/1943-how-to-write-the-perfect-pull-request) which has some great tips and advice.

## Reporting an Issue

Expand All @@ -25,7 +25,7 @@ A Dockerfile is included in this repository for development. All make commands u
An initial setup will need to be run to install the environment:

```shell
$ make install
$ make build
```

A complete list of commands can be found by running: `$ make help`
Expand All @@ -42,8 +42,8 @@ Or run individual suites using:

```shell
$ make test-unit
$ make test-integration
$ make test-matrix
$ make test-example
```

You can get a coverage report in text, html and clover XML formats:
Expand Down
11 changes: 1 addition & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DOCKER_RUN := docker-compose run --rm test

# Building

install: ## Download the dependencies then build the image :rocket:.
build: ## Download the dependencies then build the image :rocket:.
make 'composer-install --optimize-autoloader --ignore-platform-reqs'

composer-%: ## Run a composer command, `make "composer-<command> [...]"`.
Expand All @@ -36,9 +36,6 @@ lint-fix: ## Run phpcsf and fix possible lint errors.
test-unit: ## Run the unit testsuite.
${DOCKER_RUN} vendor/bin/phpunit --colors=always --testsuite unit

test-integration: ## Run the integration testsuite
docker-compose run --rm test-integration vendor/bin/phpunit --colors=always --testsuite integration

test-example: ## Run the example app
${DOCKER_RUN} php tests/example/app.php

Expand All @@ -57,12 +54,6 @@ test-coverage-html: ## Run all tests and output coverage to html.
test-coverage-clover: ## Run all tests and output clover coverage to file.
${DOCKER_RUN} phpdbg7 -qrr vendor/bin/phpunit --coverage-clover=./tests/report/coverage.clover

test-echo: ## Run an echo server
docker-compose up -d echo

test-echo-stop: ## Stop the echo server
docker-compose stop echo

# Help

help: ## Show this help message.
Expand Down
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Buffered Console
# Console Diff Renderer

[![Latest Version on Packagist](https://img.shields.io/packagist/v/graze/buffered-console.svg?style=flat-square)](https://packagist.org/packages/graze/buffered-console)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/graze/console-diff-renderer.svg?style=flat-square)](https://packagist.org/packages/graze/console-diff-renderer)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/graze/buffered-console/master.svg?style=flat-square)](https://travis-ci.org/graze/buffered-console)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/graze/buffered-console.svg?style=flat-square)](https://scrutinizer-ci.com/g/graze/buffered-console/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/graze/buffered-console.svg?style=flat-square)](https://scrutinizer-ci.com/g/graze/buffered-console)
[![Total Downloads](https://img.shields.io/packagist/dt/graze/buffered-console.svg?style=flat-square)](https://packagist.org/packages/graze/buffered-console)
[![Build Status](https://img.shields.io/travis/graze/console-diff-renderer/master.svg?style=flat-square)](https://travis-ci.org/graze/console-diff-renderer)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/graze/console-diff-renderer.svg?style=flat-square)](https://scrutinizer-ci.com/g/graze/console-diff-renderer/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/graze/console-diff-renderer.svg?style=flat-square)](https://scrutinizer-ci.com/g/graze/console-diff-renderer)
[![Total Downloads](https://img.shields.io/packagist/dt/graze/console-diff-renderer.svg?style=flat-square)](https://packagist.org/packages/graze/console-diff-renderer)

Update a multi-line console output, but only write what has changed
Only render things that have changed to the console.

[![asciicast](https://asciinema.org/a/bokpbfbg8d4yolihmfimtoaqb.png)](https://asciinema.org/a/bokpbfbg8d4yolihmfimtoaqb)
[![asciicast](https://asciinema.org/a/9233umuuyo8gi0gifmnudjz26.png)](https://asciinema.org/a/9233umuuyo8gi0gifmnudjz26)

## Usage

```php
$output = new BufferedConsoleOutput($existing);
$output = new DiffConsoleOutput($existing);

$output->reWrite([
'first line',
Expand All @@ -39,16 +39,22 @@ This will navigate the cursor to the end of `first line` and write ` here` then
Via Composer

``` bash
$ composer require graze/buffered-console
$ composer require graze/console-diff-renderer
```

## Testing
## Development

``` bash
```bash
$ make build
```

### Testing

```bash
$ make test
```

## Contributing
### Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "graze/buffered-console",
"name": "graze/console-diff-renderer",
"description": "only write output to a console that has changed",
"keywords": [
"graze",
"buffered-console"
"console-diff-renderer"
],
"homepage": "https://github.com/graze/buffered-console",
"homepage": "https://github.com/graze/console-diff-renderer",
"license": "MIT",
"authors": [
{
Expand All @@ -32,14 +32,14 @@
},
"autoload": {
"psr-4": {
"Graze\\BufferedConsole\\": "src"
"Graze\\DiffRenderer\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Graze\\BufferedConsole\\Test\\": "tests/src",
"Graze\\BufferedConsole\\Test\\Unit\\": "tests/unit",
"Graze\\BufferedConsole\\Test\\Integration\\": "tests/integration"
"Graze\\DiffRenderer\\Test\\": "tests/src",
"Graze\\DiffRenderer\\Test\\Unit\\": "tests/unit",
"Graze\\DiffRenderer\\Test\\Integration\\": "tests/integration"
}
}
}
6 changes: 3 additions & 3 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0"?>
<!--
~ This file is part of graze/buffered-console.
~ This file is part of graze/console-diff-renderer.
~
~ Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
~
~ For the full copyright and license information, please view the LICENSE
~ file that was distributed with this source code.
~
~ @license https://github.com/graze/buffered-console/blob/master/LICENSE.md
~ @link https://github.com/graze/buffered-console
~ @license https://github.com/graze/console-diff-renderer/blob/master/LICENSE.md
~ @link https://github.com/graze/console-diff-renderer
-->

<ruleset name="graze/standards">
Expand Down
9 changes: 3 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ This file is part of graze/buffered-console.
~ This file is part of graze/console-diff-renderer.
~
~ Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
~
~ For the full copyright and license information, please view the LICENSE
~ file that was distributed with this source code.
~
~ @license https://github.com/graze/buffered-console/blob/master/LICENSE.md
~ @link https://github.com/graze/buffered-console
~ @license https://github.com/graze/console-diff-renderer/blob/master/LICENSE.md
~ @link https://github.com/graze/console-diff-renderer
-->

<phpunit bootstrap="vendor/autoload.php"
Expand All @@ -25,9 +25,6 @@
<testsuite name="unit">
<directory>tests/unit</directory>
</testsuite>
<testsuite name="integration">
<directory>tests/integration</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
Expand Down
8 changes: 4 additions & 4 deletions src/Diff/ConsoleDiff.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
/**
* This file is part of graze/buffered-console.
* This file is part of graze/console-diff-renderer.
*
* Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license https://github.com/graze/buffered-console/blob/master/LICENSE.md
* @link https://github.com/graze/buffered-console
* @license https://github.com/graze/console-diff-renderer/blob/master/LICENSE.md
* @link https://github.com/graze/console-diff-renderer
*/

namespace Graze\BufferedConsole\Diff;
namespace Graze\DiffRenderer\Diff;

use Symfony\Component\Console\Output\OutputInterface;

Expand Down
8 changes: 4 additions & 4 deletions src/Diff/FirstDiff.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
/**
* This file is part of graze/buffered-console.
* This file is part of graze/console-diff-renderer.
*
* Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license https://github.com/graze/buffered-console/blob/master/LICENSE.md
* @link https://github.com/graze/buffered-console
* @license https://github.com/graze/console-diff-renderer/blob/master/LICENSE.md
* @link https://github.com/graze/console-diff-renderer
*/

namespace Graze\BufferedConsole\Diff;
namespace Graze\DiffRenderer\Diff;

class FirstDiff
{
Expand Down
18 changes: 9 additions & 9 deletions src/BufferedConsoleOutput.php → src/DiffConsoleOutput.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php

/**
* This file is part of graze/buffered-console.
* This file is part of graze/console-diff-renderer.
*
* Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license https://github.com/graze/buffered-console/blob/master/LICENSE.md
* @link https://github.com/graze/buffered-console
* @license https://github.com/graze/console-diff-renderer/blob/master/LICENSE.md
* @link https://github.com/graze/console-diff-renderer
*/

namespace Graze\BufferedConsole;
namespace Graze\DiffRenderer;

use Graze\BufferedConsole\Diff\ConsoleDiff;
use Graze\BufferedConsole\Terminal\Terminal;
use Graze\BufferedConsole\Terminal\TerminalInterface;
use Graze\BufferedConsole\Wrap\Wrapper;
use Graze\DiffRenderer\Diff\ConsoleDiff;
use Graze\DiffRenderer\Terminal\Terminal;
use Graze\DiffRenderer\Terminal\TerminalInterface;
use Graze\DiffRenderer\Wrap\Wrapper;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -26,7 +26,7 @@
* This takes an array of lines to write to the console, does a different and only over-writes what has changed to the
* console
*/
class BufferedConsoleOutput implements ConsoleOutputInterface
class DiffConsoleOutput implements ConsoleOutputInterface
{
/** @var string[] */
private $buffer = [];
Expand Down
8 changes: 4 additions & 4 deletions src/Terminal/ANSI.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
/**
* This file is part of graze/buffered-console.
* This file is part of graze/console-diff-renderer.
*
* Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license https://github.com/graze/buffered-console/blob/master/LICENSE.md
* @link https://github.com/graze/buffered-console
* @license https://github.com/graze/console-diff-renderer/blob/master/LICENSE.md
* @link https://github.com/graze/console-diff-renderer
*/

namespace Graze\BufferedConsole\Terminal;
namespace Graze\DiffRenderer\Terminal;

class ANSI implements CursorInterface
{
Expand Down
8 changes: 4 additions & 4 deletions src/Terminal/CursorInterface.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
/**
* This file is part of graze/buffered-console.
* This file is part of graze/console-diff-renderer.
*
* Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license https://github.com/graze/buffered-console/blob/master/LICENSE.md
* @link https://github.com/graze/buffered-console
* @license https://github.com/graze/console-diff-renderer/blob/master/LICENSE.md
* @link https://github.com/graze/console-diff-renderer
*/

namespace Graze\BufferedConsole\Terminal;
namespace Graze\DiffRenderer\Terminal;

interface CursorInterface
{
Expand Down
8 changes: 4 additions & 4 deletions src/Terminal/DimensionsInterface.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
/**
* This file is part of graze/buffered-console.
* This file is part of graze/console-diff-renderer.
*
* Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license https://github.com/graze/buffered-console/blob/master/LICENSE.md
* @link https://github.com/graze/buffered-console
* @license https://github.com/graze/console-diff-renderer/blob/master/LICENSE.md
* @link https://github.com/graze/console-diff-renderer
*/

namespace Graze\BufferedConsole\Terminal;
namespace Graze\DiffRenderer\Terminal;

interface DimensionsInterface
{
Expand Down
8 changes: 4 additions & 4 deletions src/Terminal/Terminal.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
/**
* This file is part of graze/buffered-console.
* This file is part of graze/console-diff-renderer.
*
* Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license https://github.com/graze/buffered-console/blob/master/LICENSE.md
* @link https://github.com/graze/buffered-console
* @license https://github.com/graze/console-diff-renderer/blob/master/LICENSE.md
* @link https://github.com/graze/console-diff-renderer
*/

namespace Graze\BufferedConsole\Terminal;
namespace Graze\DiffRenderer\Terminal;

use Symfony\Component\Console\Terminal as SymfonyTerminal;

Expand Down
8 changes: 4 additions & 4 deletions src/Terminal/TerminalInterface.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
/**
* This file is part of graze/buffered-console.
* This file is part of graze/console-diff-renderer.
*
* Copyright (c) 2017 Nature Delivered Ltd. <https://www.graze.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license https://github.com/graze/buffered-console/blob/master/LICENSE.md
* @link https://github.com/graze/buffered-console
* @license https://github.com/graze/console-diff-renderer/blob/master/LICENSE.md
* @link https://github.com/graze/console-diff-renderer
*/

namespace Graze\BufferedConsole\Terminal;
namespace Graze\DiffRenderer\Terminal;

interface TerminalInterface extends CursorInterface, DimensionsInterface
{
Expand Down
Loading

0 comments on commit d2ff2cc

Please sign in to comment.