Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to include a file? #87

Open
colindean opened this issue Oct 10, 2016 · 0 comments
Open

How to include a file? #87

colindean opened this issue Oct 10, 2016 · 0 comments

Comments

@colindean
Copy link

I'm using ruby-hocon to construct a HOCON file.

Setting values is pretty straightforward, e.g. myconf.set_value("whatever.somewhere", "some_value"), but I'm having trouble tracking down how to set an include.

This is what I want the output to be:

top { 
  something {
    include "junk/something.conf"
  }
}

I've got this already:

doc = Hocon::Parser::ConfigDocumentFactory.parse_file("config/application.conf")

And #set_value and #set_config_value seem to work great for basic types, but I can't for the life of me figure out how to set an include within a key's context. I see that non-file includes are not supported, but have a feeling that includes are only supported in the context of reading config files, not writing them.

How can I accomplish this? I've pored over the docs and the code for about an hour and I'm coming up short 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant