2017 © Pedro Peláez
 

project diff

Utility for finding differences in configuration files

image

eq/diff

Utility for finding differences in configuration files

  • Tuesday, January 30, 2018
  • by eq
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Diff Finder

Build Status Maintainability Test Coverage, (*1)

Description

Utility for finding differences in configuration files., (*2)

Supported JSON and YAML files., (*3)

Installation

$ composer require eq/diff, (*4)

Usage

$ ~/vendor/bin/gendiff -h
Generate diff

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

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

Pretty output:, (*5)

$ ~/vendor/bin/gendiff first.json second.json
   {
       "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"
       }
   }

Plain output:, (*6)

$ ~/vendor/bin/gendiff --format plain first.json second.json
Property 'common.setting2' was removed
Property 'common.setting6' was removed
Property 'common.setting4' was added with value: 'blah blah'
Property 'common.setting5' was added with value: 'complex value'
Property 'group1.baz' was changed. From 'bas' to 'bars'
Property 'group2' was removed
Property 'group3' was added with value: 'complex value'

JSON output:, (*7)

$ ~/vendor/bin/gendiff --format json first.json second.json
[{"key":"common","type":"nested","children":[{"key":"setting1","type":"unchanged","from":"Value 1","to":null},{"key":"setting2","type":"removed","from":"200","to":null},{"key":"setting3","type":"unchanged","from":true,"to":null},{"key":"setting6","type":"removed","from":{"key":"value"},"to":null},{"key":"setting4","type":"added","from":"blah blah","to":null},{"key":"setting5","type":"added","from":{"key5":"value5"},"to":null}]},{"key":"group1","type":"nested","children":[{"key":"baz","type":"changed","from":"bas","to":"bars"},{"key":"foo","type":"unchanged","from":"bar","to":null}]},{"key":"group2","type":"removed","from":{"abc":"12345"},"to":null},{"key":"group3","type":"added","from":{"fee":"100500"},"to":null}]

The Versions

30/01 2018

dev-master

9999999-dev

Utility for finding differences in configuration files

  Sources   Download

MIT

The Requires

 

The Development Requires

by ramazan

09/10 2017

1.0.0

1.0.0.0

Utility for finding differences in configuration files

  Sources   Download

MIT

The Requires

 

The Development Requires

by ramazan