Using Ruby files in tfvars folder

Hi, I remember seeing somewhere that you can put ruby files into the tfvars folder and terraspace will execute them during the build (i can see from the sourcecode that .rb files are supported alongside .tfvars). I’ve got this to work and can see that my ruby is processed during the build, but it results in an empty json file. My knowledge of ruby isn’t great and for the life of me I cannot work out what I need to put in there to get even an empty json object outputted.

For reference I’m trying to use the power of layering and ruby to store module versions under the tfvars folder alongside the configuration and a custom-helper to output the pre-loaded version details. This allowed me to leverage the inbuilt layering and seemed a better option than having the helper try and find/read a separate config file

Any ideas?


Answered my own question after some sleep and looking at the Terraspace source again, I needed to put a tfvar method call into the ruby with a pair of arguments (variable name and value).
It’s a shame that the current parser generates an empty JSON file if the ruby doesn’t contain any DSL entries - my preference would be no JSON file or simply output an empty object ({})