/factorio-spaces

Primary LanguageRubyMIT LicenseMIT

Spaces

Add width and height diminsions to the dependany graph generated by factorio-product-dependency-graph.

Requirements

Installing the app

bundle install

Usage

$ ruby main.rb --help

Adds height and width dimensions to Factorio recipes.

Usage:
  main --help | --version
  main [options] [path]

Options:
  --pretty                      Display output as human readable
  --help                        Show this message.
  --version                     Print the version.

Reading from a file (input.json)

$ ruby main.rb input.json

{"items":[{"items":[],"name":"iron-ore","width":1,"height":1}],"name":"iron-plate","width":5,"height":3}

Reading from standard in without pretty output

$ cat input.json | ruby main.rb --pretty

{
  "items": [
    {
      "items": [

      ],
      "name": "iron-ore",
      "width": 1,
      "height": 1
    }
  ],
  "name": "iron-plate",
  "width": 5,
  "height": 3
}

Testing

Use rspec to run the test suite.

$ bundle exec rspec
.....

Finished in 0.00222 seconds (files took 0.05446 seconds to load)
5 examples, 0 failures

Contributing

:aussidavid: David Milanese

Questions

Contact me with any questions: email, GitHub