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

Default overwrites config file #26

Open
nijotz opened this issue Aug 12, 2015 · 0 comments
Open

Default overwrites config file #26

nijotz opened this issue Aug 12, 2015 · 0 comments

Comments

@nijotz
Copy link

nijotz commented Aug 12, 2015

If I use the following setup:

module ConfigFile
  def self.settings
    Settings.use :env_var
    Settings.read('./config.yaml') if File.exist?('./config.yaml')
    Settings.define 'api_token', env_var: 'API_TOKEN'
    Settings.define 'tool_key', default: '', env_var: 'TOOL_KEY'
    Settings.resolve!
    Settings
  end
end

then tool_key will be en empty string, regardless of whether it's set in the config.yaml file. If I move the Settings.read to after all the defines, then the config file overrides the environment variables. I want to have defaults -> config file -> env vars -> command line

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