Skip to content

v0.12.1

Compare
Choose a tag to compare
@dry-bot dry-bot released this 15 Feb 10:10

Added

  • Settings may be specified with a cloneable option, e.g.
setting :component_dirs, Configuration::ComponentDirs.new, cloneable: true

This change makes it possible to provide “rich” config values that carry their own
configuration interface.

In the above example, ComponentDirs could provide its own API for adding component
dirs and configuring aspects of their behavior at the same time. By being passed to
the setting along with cloneable: true, dry-configurable will ensure the setting's
values are cloned along with the setting at all the appropriate times.

A custom cloneable setting value should provide its own #initialize_copy (used by
Object#dup) with the appropriate logic. (@timriley in #102)

Fixed

  • Only #initialize instance method is prepended, leaving the rest of the instance
    methods to be included as normal again. This allows classes including
    Dry::Configurable to override instance methods with their own methods as required
    (@adam12 in #103)

Compare v0.12.0...v0.12.1