Interesting behavior (bug or useful feature ?)


When declaring a dry-system module, the inherited dry-container (DSL) setting allow to declare
some new settings entries, but after the call to configure all other settings calls, properly add
new entries into the @settings array, but they aren’t resolved.

example :

module Cube
  class Container < Dry::System::Container
    env = ENV.fetch('ENV', ENV.fetch('RACK_ENV', 'development')).to_sym
    setting :env, env
    setting :toto, "toto"

   # after this call, no new `setting` entry will be returned
   # by a call to <container>.config.<entry>
   configure do |config| = :cube
      config.auto_register = %w[components]

    setting :tutu, "tutu"

Before the call to configure

=> :development
=> "toto"


=> +tutu+ is not a setting name

I found this interesting and with some added benefits as it allow to have some settings freezing
without having to change dry-container configurable options that are tied to dry-system logic, just
for the purpose of adding new `attributes/settings’ to the root Container.

Is this a ‘feature’ valuable enough to merit some note, or if this is a bug it is better not to count on it :wink: