mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Dumb auto-format
This commit is contained in:
parent
e3e4cac9c1
commit
edabaa9447
1 changed files with 13 additions and 15 deletions
|
@ -114,21 +114,19 @@ module Spectator
|
|||
let({{assignment.target}}) { {{assignment.value}} }
|
||||
{% end %}
|
||||
|
||||
{%
|
||||
# Trick to get the contents of the block as an array of nodes.
|
||||
# If there are multiple expressions/statements in the block,
|
||||
# then the body will be a `Expressions` type.
|
||||
# If there's only one expression, then the body is just that.
|
||||
body = if block.is_a?(Nop)
|
||||
raise "Missing block for 'given'"
|
||||
elsif block.body.is_a?(Expressions)
|
||||
# Get the expressions, which is already an array.
|
||||
block.body.expressions
|
||||
else
|
||||
# Wrap the expression in an array.
|
||||
[block.body]
|
||||
end
|
||||
%}
|
||||
{% # Trick to get the contents of the block as an array of nodes.
|
||||
# If there are multiple expressions/statements in the block,
|
||||
# then the body will be a `Expressions` type.
|
||||
# If there's only one expression, then the body is just that.
|
||||
body = if block.is_a?(Nop)
|
||||
raise "Missing block for 'given'"
|
||||
elsif block.body.is_a?(Expressions)
|
||||
# Get the expressions, which is already an array.
|
||||
block.body.expressions
|
||||
else
|
||||
# Wrap the expression in an array.
|
||||
[block.body]
|
||||
end %}
|
||||
|
||||
{% for item in body %}
|
||||
# If the item starts with "it", then leave it as-is.
|
||||
|
|
Loading…
Reference in a new issue