Low commit activity in last 3 years
No release in over a year
Read a config file and write it to a YAML file under specific key
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.1
~> 2.3
 Project Readme

Structure Butcher

This library is for playing with configs (in YAML, Hocon, JSON, JavaProperties). It provides two scripts:

  • amputator.rb - reads a part of the config structure given filename and path to a key.

  • implantator.rb - writes a given data structure into a file on a place specified by a path to a key

Example:

$ cat body.yaml
---
one:
  two:
    three:
      hash:
        one: 1
        two: 2
        three: 3

$ bin/amputator.rb body.yaml one.two.three.hash part.json

$ cat part.json
{"one":1,"two":2,"three":3}

$ bin/implantator.rb body.yaml one.two part.json

$ cat body.yaml
---
one:
  two:
    one: 1
    two: 2
    three: 3

For examples on how to use the library, see tests.