Konfiguracja

State of art

  • rails credentials
  • Rails.application.config global
  • config_for helper
  • ENV
  • Figaro and dotenv

Some of the problems

  • you have to know where is your specific config
  • defaults and overrides based on ifs and "or"
  • defaults for development vs defaults for a deployment
  • lack of coercion
  • lack of verification that required values are provided
  • ENV hell
@foo = ENV["FOO"] || "foo"
do_foo(Rails.configuration.foo)
key_bar = config_for(:bar)["key"]

Your code has to know the infrastructure

anyway_config

anyway_config

+

dry-struct

konfiguracja

github.com/jandudulski/konfiguracja

Thanks!

@yanoo_

Konfiguracja

By Jan Dudulski

Konfiguracja

  • 86