Skip to content

Commit

Permalink
green examples and features
Browse files Browse the repository at this point in the history
  • Loading branch information
liuggio committed Jun 26, 2014
1 parent cbba585 commit c928abb
Show file tree
Hide file tree
Showing 26 changed files with 2,025 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/bin
/vendor
/bin/behat
/bin/phpspec
/vendor
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ php:
- 5.5
- hhvm

services:
- redis-server

matrix:
allow_failures:
- php: hhvm
Expand All @@ -17,7 +14,8 @@ before_script:
- COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev --no-interaction install

script:
- bin/phpunit -v
- bin/phpspec run --format=pretty
- bin/behat

notifications:
email:
Expand Down
104 changes: 103 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,106 @@ PHP badges poser
================

This is a php library that creates badges,
according to [Shields specification](https://github.com/badges/shields#specification).
according to [Shields specification](https://github.com/badges/shields#specification).

``` bash
________________
|_ _ _| _ _ | _ _ _ _ _ |
|_)(_|(_|(_|(/_ | |_)(_)_\(/_| |
_| |_|______________|

```
This library create this: ![badge-poser](badge-poser.svg) and ![I'm a badge](i_m-badge.svg) and ![dark](today-dark.svg)...
This library is used by the most used badge creator in php https://poser.pugx.org/
## Usage as library
#### 1. Add to composer
`composer require badge/poser ~0.1`
#### 2. Use in your project as lib
``` php
use PUGX\Poser\Render\SvgRender;
use PUGX\Poser\Poser;
$render = new SvgRender();
$poser = new Poser(array('svg' => $render));
echo $poser->generate('license', 'MIT', '428F7E', 'svg');
// or
echo $poser->generateFromURI('license-MIT-428F7E.svg');
```
## Use in your project as command
#### 1. Add to composer
`$ composer require badges/poser ~0.1`
or create a project
`$ composer create-project badges/poser ~0.1`
and make the link
`$ ln -s poser/bin/poser /usr/local/bin/poser`
#### 2. lunch the command
Creating an image
`$ poser license MIT blue -p "license.svg"`
Flushing the image
`$ poser license MIT blue`
## Encoding
Dashes `--` → `-` Dash
Underscores `__` → `_` Underscore
`_` or Space → Space
## More
For *more info* please see the [behat features](./features/)
and the examples in the [php-spec folder](./spec/)
## Contribution
Active contribution and patches are very welcome.
See the [github issues](https://github.com/PUGX/poser/issues?state=open).
To keep things in shape we have quite a bunch of examples and features. If you're submitting pull requests please
make sure that they are still passing and if you add functionality please
take a look at the coverage as well it should be pretty high :)
- First fork or clone the repository
```
git clone git://github.com/badges/poser.git
cd poser
```
- Install vendors:
``` bash
composer install
```
- Run specs:
``` bash
./bin/phpspec run --format=pretty
```
- Then run behat:
``` bash
./bin/behat run
```
18 changes: 18 additions & 0 deletions badge-poser.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions bin/poser
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env php
<?php

if (is_dir($vendor = getcwd() . '/vendor')) {
require $vendor . '/autoload.php';
}

if (is_dir($vendor = __DIR__ . '/../vendor')) {
require($vendor . '/autoload.php');
} elseif (is_dir($vendor = __DIR__ . '/../../..')) {
require($vendor . '/autoload.php');
} else {
die(
'You must set up the project dependencies, run the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
}

use PUGX\Poser\UI\Command;
use PUGX\Poser\UI\SingleCommandApplication;

$application = new SingleCommandApplication(new Command(), '1.0');
$application->run();
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pugx/poser",
"description": "Poser, add badges on your readme, such as downloads number or latest version.",
"name": "badges/poser",
"description": "Poser, add badges on your readme..",
"keywords": ["composer", "packagist", "badge", "pin"],
"homepage": "https://github.com/PUGX",
"type": "lib",
Expand All @@ -20,17 +20,20 @@
}
],
"autoload": {
"psr-4": { "PUGX\\Badge\\Poser": "src/" }
"psr-4": { "PUGX\\Poser\\": "src/" }
},
"require": {
"symfony/console": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "@stable"
"phpspec/phpspec": "dev-master",
"behat/behat": "dev-master"
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "stable",
"bin": ["bin/poser"],
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
Expand Down
Loading

0 comments on commit c928abb

Please sign in to comment.