Skip to content

Commit edfcffc

Browse files
stephen-solteszsparkprime
authored andcommitted
Fix conditionals example.
This change updates the conditionals example to exclude only the alcoholic ingredient when virgin=true.
1 parent 520961d commit edfcffc

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

doc/_includes/examples/conditionals.jsonnet

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ local Mojito(virgin=false, large=false) = {
1010
qty: 6 * factor,
1111
unit: 'leaves',
1212
},
13-
] + if virgin then [] else [
14-
{ kind: 'Banks', qty: 1.5 * factor },
15-
] + [
13+
] + (
14+
if virgin then [] else [
15+
{ kind: 'Banks', qty: 1.5 * factor },
16+
]
17+
) + [
1618
{ kind: 'Lime', qty: 0.5 * factor },
1719
{ kind: 'Simple Syrup', qty: 0.5 * factor },
1820
{ kind: 'Soda', qty: 3 * factor },

doc/_includes/examples/conditionals.jsonnet.golden

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@
6363
"kind": "Mint",
6464
"qty": 6,
6565
"unit": "leaves"
66+
},
67+
{
68+
"kind": "Lime",
69+
"qty": 0.5
70+
},
71+
{
72+
"kind": "Simple Syrup",
73+
"qty": 0.5
74+
},
75+
{
76+
"kind": "Soda",
77+
"qty": 3
6678
}
6779
],
6880
"served": "Over crushed ice"

examples/conditionals.jsonnet

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ local Mojito(virgin=false, large=false) = {
2626
qty: 6 * factor,
2727
unit: 'leaves',
2828
},
29-
] + if virgin then [] else [
30-
{ kind: 'Banks', qty: 1.5 * factor },
31-
] + [
29+
] + (
30+
if virgin then [] else [
31+
{ kind: 'Banks', qty: 1.5 * factor },
32+
]
33+
) + [
3234
{ kind: 'Lime', qty: 0.5 * factor },
3335
{ kind: 'Simple Syrup', qty: 0.5 * factor },
3436
{ kind: 'Soda', qty: 3 * factor },

examples/conditionals.jsonnet.golden

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@
6363
"kind": "Mint",
6464
"qty": 6,
6565
"unit": "leaves"
66+
},
67+
{
68+
"kind": "Lime",
69+
"qty": 0.5
70+
},
71+
{
72+
"kind": "Simple Syrup",
73+
"qty": 0.5
74+
},
75+
{
76+
"kind": "Soda",
77+
"qty": 3
6678
}
6779
],
6880
"served": "Over crushed ice"

0 commit comments

Comments
 (0)