summaryrefslogtreecommitdiff
path: root/CHANGELOG.md
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2019-03-25 02:40:05 +0200
committerKyrylo Silin <silin@kyrylo.org>2019-05-02 00:10:37 +0300
commite5556a2be8627ec3fe594c738f10422d5a1f5d43 (patch)
treea1758a1f39915a4eb076793a36d485cb7145d638 /CHANGELOG.md
parent03afca9eafe4f2981edad1cfe4346a643fb64d72 (diff)
downloadpry-e5556a2be8627ec3fe594c738f10422d5a1f5d43.tar.gz
Refactor Config
Fixes #1843 (Rework the Pry config) There are a few breaking changes. They are mostly minor, so I decided not to indroduce deprecations because it will considerable slow things down. Key changes: * `Pry.lazy` was replaced with `Pry::Configuration::LazyValue` The config accepts three values now `LazyValue`, `MemoizedValue` and simply `Value`. The main difference is that: - `Value` is any value, including procs (so that an option returns a raw proc) - `LazyValue` is a proc that is call on every invocation of an option - `MemoizedValue` is a value that is called only once (and then the option always returns the return value of the ) * `Pry.config.history` was a meta-option that held suboptions. However, the new config doesn't permit that (unless you know what you do) Instead, we introduce a few options. For example: - `Pry.config.history.histignore` becomes `Pry.config.history_ignorelist` - `Pry.config.history.file` becomes `Pry.config.history_file` - and so on This was done so we can simplify configuration merging. Inlining option makes configuration implementation simpler, without losing much. The rule is that you want to keep your options under your prefix (if you are a plugin). Therefore, say, `Pry.config.pry_rescue.*` should be `Pry.config.pry_rescue_*` if you need merging. The rest should behave in a similar fashion (and I rely heavily on our test suite to claim so).
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r--CHANGELOG.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e7c238ac..d259460c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,9 @@
* Added ability to forward ARGV to a Pry session via `--` (or `-`) when
launching Pry from shell
([#1902](https://github.com/pry/pry/commit/5cd65d3c0eb053f6edcdf571eea5d0cd990626ed))
+* Added `Pry::Config::LazyValue` & `Pry::Config::MemoizedValue`, which allow
+ storing callable procs in the config
+ ([#2024](https://github.com/pry/pry/pull/2024))
#### API changes
@@ -65,6 +68,8 @@
([#2001](https://github.com/pry/pry/pull/2001))
* Deleted `Pry::BlockCommand#opts` (use `#context` instead)
([#2003](https://github.com/pry/pry/pull/2003))
+* Deleted `Pry.lazy` (use `Pry::Config::LazyValue` instead)
+ ([#2024](https://github.com/pry/pry/pull/2024))
#### Bug fixes