Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 withPry::Configuration::LazyValue
The config accepts three values now
LazyValue
,MemoizedValue
and simplyValue
. The main difference is that:Value
is any value, including procs (so that an option returns a rawproc)
LazyValue
is a proc that is call on every invocation of an optionMemoizedValue
is a value that is called only once (and then the optionalways returns the return value of the )
Pry.config.history
was a meta-option that held suboptions. However, the newconfig doesn't permit that (unless you know what you do)
Instead, we introduce a few options. For example:
Pry.config.history.histignore
becomesPry.config.history_ignorelist
Pry.config.history.file
becomesPry.config.history_file
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 bePry.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).