Commit ade72a1
committed
stdlib::ensure: update function to spport the generic case
Often custom resources only support present/absent for the ensure
paramater and often the includtion of theses resources are enabled via
some boolean value as such i often find my self using the following
pattern
$ensure_feature = $enable_feature.bool2str('ensure', 'present')
This patch updates the stdlib::ensure function so we can simplify this to
$ensure_feature = $enable_feature.stdlib::ensure # or ...
$ensure_feature = stdlib::ensure($enable_feature) # or ...
$ensure_feature = stdlib::ensure($enable_feature, 'present')1 parent e1977c5 commit ade72a1
2 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
| |||
0 commit comments