Code Monkey home page Code Monkey logo

p6-warthog's Introduction

WELCOME TO WARTHOG

I does build decisions.

Usage

use System::Query;
use JSON::Fast;

my $json      = from-json("build.json".IO.slurp);
my $decisions = system-collapse($json);

qw<...>;

Input

Calling parse with the following JSON will run through and choose what it thinks is the best options in the environment.

{
  "nested": {
    "test": "data"
  },
  "nested2": {
    "test2": "data2"
  },
  "options": {
    "run": {
      "by-distro.name": {
        "macosx": {
          "by-distro.version": {
            "10.0+": "10make",
            "9.0+": "9make",
            "8.0+": "8make"
          }
        },
        "win32": {
          "by-distro.version": {
            "6+": "6winmake",
            "5+": "5winmake" 
          }
        },
        "": "null-make"
      }
    }
  },
  "default-test": {
    "second-test": "string-val, no decisions",
    "first-test": {
      "by-distro.name": {
        "": "default-option1"
      }
    }
  }
}

Output

This is the result of the parse; notice that the distro/kernel/etc queries collapse to show the decisions based on variables.

{
  default-test => {
    first-test  => "default-option1".Str,
    second-test => "string-val, no decisions".Str,
  },
  nested       => {
    test => "data".Str,
  },
  nested2      => {
    test2 => "data2".Str,
  },
  options      => {
    run => "10make".Str,
  },
}

p6-warthog's People

Contributors

tony-o avatar niner avatar

Stargazers

 avatar Juan Julián Merelo Guervós avatar

Watchers

James Cloos avatar  avatar Lloyd Fournier avatar  avatar

Forkers

niner

p6-warthog's Issues

META6.json is missing a `license` field

There's no information about the license in META6.json. This prevents me from creating an openSUSE package as the OpenBuildService requires a License tag in the .spec file.

Typo?

$*DISTRO in this line needs to be $PTR?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.