Recent Releases of https://github.com/dry-rb/dry-configurable
https://github.com/dry-rb/dry-configurable - v1.3.0
Changed
- Set minimum Ruby version to 3.1 (@flash-gordon)
- Ruby
Published by dry-bot about 1 year ago
https://github.com/dry-rb/dry-configurable - v1.2.0
Changed
- Allow
Dry::Configurablemixin to be included multiple times in a class hierarchy (#164 by @timriley) - Deprecate
Dry::Configurable::AlreadyIncludedError(#164 by @timriley)
- Ruby
Published by dry-bot over 1 year ago
https://github.com/dry-rb/dry-configurable - v1.1.0
Fixed
- Allow nested settings to default to
Undefined(fixes #158 via #161) (@emptyflask)
- Ruby
Published by dry-bot over 2 years ago
https://github.com/dry-rb/dry-configurable - v1.0.1
Changed
- Renamed
@configand@_settingsinternal instance variables to@__config__and@__settings__in order to avoid clashes with user-defined instance variables (#159 by @timriley)
- Ruby
Published by dry-bot over 3 years ago
https://github.com/dry-rb/dry-configurable - v1.0.0
Changed
- Dependency on
dry-corewas updated to ~> 1.0 (@solnic)
- Ruby
Published by dry-bot over 3 years ago
https://github.com/dry-rb/dry-configurable - v0.16.1
0.16.1 2022-10-13
Changed
- Restored performance of config value reads (direct reader methods as well as aggregate methods like
#valuesand#to_h) to pre-0.16.0 levels (#149 by @timriley)
- Ruby
Published by timriley over 3 years ago
https://github.com/dry-rb/dry-configurable - v0.16.0
Added
-
Support for custom config classes via
config_class:option (#136 by @solnic)extend Dry::Configurable(config_class: MyConfig)Your config class should inherit from
Dry::Configurable::Config. -
Return
Dry::Core::Constants::Undefined(instead of nil) as the value for non-configured settings via adefault_undefined: trueoption (#141 by @timriley)extend Dry::Configurable(default_undefined: true)You must opt into this feature via the
default_undefined: trueoption. Non-configured setting values are stillnilby default.
Fixed
- Remove exec bit from version.rb (#139 by @Fryguy)
Changed
-
Improve memory usage by separating setting definitions from config values (#138 by @timriley)
Your usage of dry-configurable may be impacted if you have been accessing objects from
_settingsor the internals ofDry::Configurable::Config._settingsnow returnsDry::Configurable::Settinginstances, which contain only the details from the setting's definition. Setting values remain inDry::Configurable::Config. -
Use Zeitwerk to speed up load time (#135 by @solnic)
- Ruby
Published by dry-bot over 3 years ago
https://github.com/dry-rb/dry-configurable - v0.15.0
Changed
-
The
finalize!method (as class or instance method, depending on whether you extend or includeDry::Configurablerespectively) now accepts a booleanfreeze_values:argument, which if true, will recursively freeze all config values in addition to theconfigitself. (#105 by @ojab)class MyConfigurable include Dry::Configurable setting :db, default: "postgre" end my_obj = MyConfigurable.new my_obj.finalize!(freeze_values: true) my_obj.config.db << "sql" # Will raise FrozenError -
Dry::Configurable::Config#updatewill set hashes as values for non-nested settings (#131 by @ojab)class MyConfigurable extend Dry::Configurable setting :sslcert, constructor: ->(v) { v&.values_at(:pem, :pass)&.join } end MyConfigurable.config.update(sslcert: {pem: "cert", pass: "qwerty"}) MyConfigurable.config.sslcert # => "certqwerty" -
Dry::Configurable::Config#updatewill accept any values implicitly convertible to hash via#to_hash(#133 by @timriley)
- Ruby
Published by dry-bot almost 4 years ago
https://github.com/dry-rb/dry-configurable - v0.14.0
Changed
- Settings defined after an access to
configwill still be made available on thatconfig. (#130 by @timriley) - Cloneable settings are cloned immediately upon assignment. (#130 by @timriley)
- Changes to config values in parent classes after subclasses have already been created will not be propogated to those subclasses. Subclasses created after config values have been changed in the parent will receive those config values. (#130 by @timriley)
- Ruby
Published by dry-bot about 4 years ago
https://github.com/dry-rb/dry-configurable - v0.13.0
Added
-
Added flags to determine whether to warn on the API usage deprecated in this release (see "Changed" section below). Set these to
falseto suppress the warnings. (#124 by @timriley)Dry::Configurable.warn_on_setting_constructor_block false Dry::Configurable.warn_on_setting_positional_default false
Fixed
- Fixed
ArgumentErrorfor classes includingDry::Configurablewhoseinitializerhas required kwargs. (#113 by @timriley)
Changed
-
Deprecated the setting constructor provided as a block. Provide it via the
constructor:keyword argument instead. (#111 by @waiting-for-dev & @timriley)setting :path, constructor: -> path { Pathname(path) } -
Deprecated the setting default provided as the second positional argument. Provide it via the
default:keyword argument instead. (#112 and #121 by @waiting-for-dev & @timriley)setting :path, default: "some/default/path" -
[BREAKING] Removed implicit
to_hashconversion fromConfig. (#114 by @timriley)
- Ruby
Published by dry-bot over 4 years ago
https://github.com/dry-rb/dry-configurable - v0.12.1
Added
- Settings may be specified with a
cloneableoption, 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
#initializeinstance method is prepended, leaving the rest of the instance
methods to be included as normal again. This allows classes including
Dry::Configurableto override instance methods with their own methods as required
(@adam12 in #103)
- Ruby
Published by dry-bot about 5 years ago
https://github.com/dry-rb/dry-configurable -
0.12.0 2020-12-26
Fixed
- Setting values provided by defaults and/or pre-processor blocks are no longer accidentally memoized across instances of classes including Dry::Configurable (#99) (@timriley & @esparta)
Changed
- Instance behavior is now prepended, so that if you have your own
initialize, callingsuperis no longer required (see #98 for more details) (@zabolotnov87) - Switched to equalizer from dry-core (@solnic)
- Ruby
Published by flash-gordon about 5 years ago
https://github.com/dry-rb/dry-configurable - v0.11.6
Changed
- A meaningful error is raised when the extension is included more than once (issue #89 fixed via #94) (@landongrindheim)
- Evaluate setting input immediately when input is provided. This allows for earlier feedback from constructors designed to raise errors on invalid input (#95) (@timriley)
- Ruby
Published by timriley over 5 years ago
https://github.com/dry-rb/dry-configurable - v0.11.5
Fixed
- When settings are copied or cloned, unevaluated values will no longer be copied. This prevents unintended crashes when settings have constructors expecting a certain type of value, but that value is yet to be provided (Fixed via #87) (@timriley)
- Ruby
Published by timriley almost 6 years ago
https://github.com/dry-rb/dry-configurable -
Fixed
- You can use
:settingsas a config key again (issue #80) (@solnic) - Setting value is lazy-evaluated now, which fixes some cases where a constructor could crash with a
nilvalue (@solnic)
- Ruby
Published by solnic almost 6 years ago
https://github.com/dry-rb/dry-configurable -
Fixed
- Warning about redefined
Setting#valueis gone (@solnic)
- Ruby
Published by solnic almost 6 years ago
https://github.com/dry-rb/dry-configurable -
Fixed
- Retrieving settings by a string name works again (issue #82) (@waiting-for-dev)
- Ruby
Published by solnic almost 6 years ago
https://github.com/dry-rb/dry-configurable -
Fixed
Config#updatereturnsselfagain (issue #60 fixed via #92) (@solnic)
Changed
Setting#inspectno longer uses its value - this could cause crashes when inspecting settings that are yet to have a value applied (e.g. when they have a constructor that expects a value to be present) (@timriley)
- Ruby
Published by solnic almost 6 years ago
https://github.com/dry-rb/dry-configurable -
A complete rewrite of the library while keeping the public API intact. See #78 for a detailed overview.
Changed
- Accessing config in a parent class no longer prevents you from adding more settings in a child class (@solnic)
- (internal) New low-level Setting and Config API (@solnic)
- (internal)
configobjects use method_missing now (@solnic)
- Ruby
Published by solnic about 6 years ago
https://github.com/dry-rb/dry-configurable -
0.9.0 - 2019-11-06
Fixed
- Support for reserved names in settings. Some Kernel methods (
public_sendandclassspecifically) are not available if you use access settings via a method call. Same for methods of theConfigclass. You can still access them with[]and[]=. Ruby keywords are fully supported. Invalid names containing special symbols (including!and?) are rejected. Note that these changes don't affect thereaderoption, if you define a setting named:classand passreader: true... well ... (flash-gordon) - Settings can be redefined in subclasses without warnings about overriding existing methods (flash-gordon)
- Fix warnings about using keyword arguments in 2.7 (koic)
- Ruby
Published by flash-gordon over 6 years ago
https://github.com/dry-rb/dry-configurable -
0.8.3 - 2019-05-29
Fixed
Configurable#dupandConfigurable#clonemake a copy of instance-level config so that it doesn't get mutated/shared across instances (flash-gordon)
- Ruby
Published by flash-gordon almost 7 years ago
https://github.com/dry-rb/dry-configurable -
0.8.2 - 2019-02-25
Fixed
- Test interface support for modules (Neznauy)
- Ruby
Published by flash-gordon about 7 years ago
https://github.com/dry-rb/dry-configurable -
0.8.1 - 2019-02-06
Fixed
.configuredoesn't require a block, this makes the behavior consistent with the previous versions (flash-gordon)
- Ruby
Published by flash-gordon about 7 years ago
https://github.com/dry-rb/dry-configurable -
0.8.0 - 2019-02-05
Fixed
- A number of bugs related to inheriting settings from parent class were fixed. Ideally, new behavior will be 💯 predictable but if you observe any anomaly, please report (flash-gordon)
Added
- Support for instance-level configuration landed. For usage,
includethe module instead of extending (flash-gordon)class App include Dry::Configurable setting :database end production = App.new production.config.database = ENV['DATABASE_URL'] production.finalize! development = App.new development.config.database = 'jdbc:sqlite:memory' development.finalize! - Config values can be set from a hash with
.update. Nested settings are supported (flash-gordon)class App extend Dry::Configurable setting :db do setting :host setting :port end config.update(YAML.load(File.read("config.yml"))) end
Changed
- [BREAKING] Minimal supported Ruby version is set to 2.3 (flash-gordon)
- Ruby
Published by flash-gordon about 7 years ago