rougin/blueprint

Bootstraps your file-generating console applications.

v0.6.0 2018-01-10 16:47 UTC

This package is auto-updated.

Last update: 2021-07-08 01:12:53 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Bootstraps your file-generating console applications.

Installation

Install Blueprint via Composer:

$ composer require rougin/blueprint

Basic Usage

Creating new blueprint.yml

$ vendor/bin/phpunit init

blueprint.yml

paths:
    templates: %%CURRENT_DIRECTORY%%/src/Templates
    commands: %%CURRENT_DIRECTORY%%/src/Commands

namespaces:
    commands: Rougin\Blueprint\Commands
  • Replace the values specified in the blueprint.yml file
  • Add your console commands and templates (if required) to their respective directories

Sample console command

blueprint.yml

...

namespaces:
    commands: Acme\Commands

src/Commands/TestCommand.php

namespace Acme\Commands;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class TestCommand extends Command
{
    protected function configure()
    {
        $this->setName('test')->setDescription('Returns a "Test" string');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('<info>Test</info>');
    }
}

Add specified namespace to composer.json

    "autoload": {
        "psr-4": {
            "Acme\\": "src"
        }
    }
$ composer dump-autoload

Run the "test" command

$ vendor/bin/blueprint test

Test

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Credits

License

The MIT License (MIT). Please see LICENSE for more information.