Add `:is_new/old()` helpers to tarantool.compat options
Open
@veod32 is already working on this.
Since Jul 13, 2023.
- Dominant language
- CSS
- Stars
- 15
- Forks
- 49
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
compat.<option_name>.current can be 'new', 'old' or 'default',
thus when it is default there must be an additional check if
compat.<option_name>.default is 'new'. It is handier to have a
helper to deal with that instead of complicated if:
- check if effective value is 'new' before the patch:
if compat.<option_name>.current == 'new' or (compat.<option_name>.current == 'default' and compat.<option_name>.default == 'new') then ... end - after the patch:
if compat.<option_name>:is_new() then ... end
Please update tutorial on using compat, maybe add an example to
Listing options details.
Requested by @Lord-KA in https://github.com/tarantool/tarantool/commit/5f6d367c51f7545a940119e7a393baf982b80f3f.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.