From bb450bd96b02b48ed8b277fa0a6ca5c97037a680 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Sat, 4 Jul 2020 13:46:25 +0200 Subject: Overhaul Config to 3.0.0 --- CHANGELOG.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 9 deletions(-) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 67252d4..db5fb95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,21 +5,58 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [UNRELEASED] +## [3.0.0] - 2020-07-02 -### Changed +`Config` has been rebuilt from the ground up. This is a relatively old +project of mine, which I used to get into Raku. I've learned many new things +in the past couple years, many things of which have been applied to this +project. + +Much of the user-facing interface is the same, however, breaking some backwards +compatibility was inevitable with some of the new ways I wanted `Config` to +function. Please read through this CHANGELOG carefully, and consider reading +the documentation if you encounter issues. If you have any questions or +remarks, you can also send an email to `~tyil/raku-devel@lists.sr.ht`. + +### Added + +- `.new` now (optionally) accepts a `Hash` which will be used as a template. + From this template, environment variables will be checked for existence, and + used if they exist. You must also set a `:name` attribute, which will be used + as a prefix for all the variables. This should make it easier to include + environment variable based configuration in applications. -- The `.read` and `.write` methods of a `Config` object now support `IO::Path` - as arguments for the `$path`, in addition to supporting the `Str` based - `$path` argument. *I intend to deprecate the `Str` variant in the future*. + Additionally, if the `:name` attribute is set, a number of standard + directories will be probed to see if there's a usable configuration file to + read. Which directories to probe is based on the [XDG Base Directory + Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). + + Both environment and XDG-path based auto-loading of configuration can be + turned off with `:!from-env` and `:!from-xdg` respectively. + +- [`Log`](https://modules.raku.org/dist/Log:cpan:TYIL) is now included to + provide some debug logging. Any application using this will get logging in + their preferred format through this. + +### Changed - Related links: +- The `Config` object is now immutable. Calling methods that alter the + configuration values (such as `.read`, `.set`, `.unset`) will now return a + new `Config` object. Raku has a very pretty [`.=` + operator](https://docs.raku.org/language/operators#infix_.=) that may come in + handy! - - [`GitHub#5`](https://github.com/scriptkitties/p6-Config/issues/5) +- The `Exception` classes are now in `X::Config`, and the redundant `Exception` + suffix has been removed. - Special thanks to: +- When setting an explicit parser, the parser must be given as a type object, + instead of a `Str`. This will lead to potential issues being known at + compile-time, rather than runtime. - - [taboege](https://github.com/taboege) +- `Config`'s license has changed from `AGPL-3.0` to `LGPL-3.0-only`. The Lesser + General Public License allows use of `Config`, even in closed code bases. + This should make the module more usable for all sorts of people, while still + maintaining a strong focus on keeping it Free Software. ## [2.1.0] - 2018-08-26 -- cgit v1.1