2017 © Pedro Peláez
 

project generate-difference

image

ravilushqa/generate-difference

  • Monday, March 19, 2018
  • by ravilushqa
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 20 % Grown

The README.md

project-lvl2-s197

Build Status Maintainability Test Coverage, (*1)

This project can generate difference between two files., (*2)

Installation

  1. For CLI
composer global require ravilushqa/generate-difference
  1. In your project
composer require ravilushqa/generate-difference

Usage

1. For CLI

Usage:
  gendiff (-h|--help)
  gendiff [--format <fmt>] <firstFile> <secondFile>

Options:
  -h --help                     Show this screen
  --format <fmt>                Report format [default: pretty]

2. For project

//todo

Supported formats

1. Formats of input files

  • yml
  • json

2. Formats of report

  • plain
  • pretty
  • json

Examples output

Input files

before.json, (*3)

{
  "common": {
    "setting1": "Value 1",
    "setting2": "200",
    "setting3": true,
    "setting6": {
      "key": "value"
    }
  },
  "group1": {
    "baz": "bas",
    "foo": "bar"
  },
  "group2": {
    "abc": "12345"
  }
}

after.json, (*4)

{
  "common": {
    "setting1": "Value 1",
    "setting3": true,
    "setting4": "blah blah",
    "setting5": {
      "key5": "value5"
    }
  },

  "group1": {
    "foo": "bar",
    "baz": "bars"
  },

  "group3": {
    "fee": "100500"
  }
}

Plain

Setting "common.setting2" deleted.
Setting "common.setting4" added with value "blah blah".
Setting "group1.baz" changed from "bas" to "bars".
Section "group2" deleted.

Pretty

```pretty { common: { setting1: Value 1 - setting2: 200 setting3: true - setting6: { key: value } + setting4: blah blah + setting5: { key5: value5 } } group1: { - baz: bas + baz: bars foo: bar } - group2: { abc: 12345 } + group3: { fee: 100500 } }, (*5)

The Versions