You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, and foremost: When configliere loads a file, it does not decorate the hash with dotted accessors. This seems like an oversight and results in unexpected behavior.
Currently, you load configuration files like this:
Settings.read("/path/to/my/config")
What if I wanted to pass the config file as a command line argument to be read in?
./my_script.rb /path/to/my/config
This needs to be interpreted in the file by my own logic then:
Settings.use:commandlineSettings.resolve!Settings.read(Settings.rest.first)# Settings.rest give you the the command line args (ARGV) passed in
This is more difficult to express than it should be. We could try including it as a param, but this is just as gross:
At least with this, the config is read in before the command line arguments are resolved, allowing for overrides.
I propose a special flag (--read_config=?) that is interpreted as "load this file by default", then proceed with other definitions, and params. This allows for command line overriding, while abstracting out a pattern that is needlessly verbose, and keeps everything conceptually related.
The text was updated successfully, but these errors were encountered:
First, and foremost: When configliere loads a file, it does not decorate the hash with dotted accessors. This seems like an oversight and results in unexpected behavior.
Currently, you load configuration files like this:
What if I wanted to pass the config file as a command line argument to be read in?
./my_script.rb /path/to/my/config
This needs to be interpreted in the file by my own logic then:
This is more difficult to express than it should be. We could try including it as a param, but this is just as gross:
./my_script.rb --config_file=/path/to/my/config
And then in my script:
At least with this, the config is read in before the command line arguments are resolved, allowing for overrides.
I propose a special flag (--read_config=?) that is interpreted as "load this file by default", then proceed with other definitions, and params. This allows for command line overriding, while abstracting out a pattern that is needlessly verbose, and keeps everything conceptually related.
The text was updated successfully, but these errors were encountered: