Jaymon / chef-cookbooks

Various Chef cookbooks
MIT License
2 stars 0 forks source link

EnvironHash improvements #40

Open Jaymon opened 3 weeks ago

Jaymon commented 3 weeks ago

It would be nice if EnvironHash could take a directory when being created, then you could just call files, something like this:

require ::File.join("cookbooks", "environ", "libraries", "environ")
environ = ::EnvironHash.new("<DIRECTORY-PATH>")
environ.load_files("common.sh", "dev.sh")

The environ script has to create an environment hash and then pass that every time it uses the environ resource, it would be nice if it could do that in the resource, this seems to be bad form, but could maybe be done?

property(:foo, default: lazy { node["whatever"] })

The reason why the EnvironHash is created in the default recipe and then passed to the resource is because it needs access to the node configuration.