mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Change tags to symbols
This commit is contained in:
parent
5166cd7778
commit
db877da984
3 changed files with 7 additions and 7 deletions
|
@ -29,16 +29,16 @@ module Spectator::DSL
|
||||||
def self.\%tags
|
def self.\%tags
|
||||||
tags = _spectator_tags
|
tags = _spectator_tags
|
||||||
\{% if !tags.empty? %}
|
\{% if !tags.empty? %}
|
||||||
tags.concat({ \{{tags.map(&.id.stringify).splat}} })
|
tags.concat({ \{{tags.map(&.id.symbolize).splat}} })
|
||||||
\{% end %}
|
\{% end %}
|
||||||
\{% for k, v in metadata %}
|
\{% for k, v in metadata %}
|
||||||
cond = begin
|
cond = begin
|
||||||
\{{v}}
|
\{{v}}
|
||||||
end
|
end
|
||||||
if cond
|
if cond
|
||||||
tags.add(\{{k.id.stringify}})
|
tags.add(\{{k.id.symbolize}})
|
||||||
else
|
else
|
||||||
tags.delete(\{{k.id.stringify}})
|
tags.delete(\{{k.id.symbolize}})
|
||||||
end
|
end
|
||||||
\{% end %}
|
\{% end %}
|
||||||
tags
|
tags
|
||||||
|
|
|
@ -20,16 +20,16 @@ module Spectator::DSL
|
||||||
def self._spectator_tags
|
def self._spectator_tags
|
||||||
tags = super
|
tags = super
|
||||||
\{% if !tags.empty? %}
|
\{% if !tags.empty? %}
|
||||||
tags.concat({ \{{tags.map(&.id.stringify).splat}} })
|
tags.concat({ \{{tags.map(&.id.symbolize).splat}} })
|
||||||
\{% end %}
|
\{% end %}
|
||||||
\{% for k, v in metadata %}
|
\{% for k, v in metadata %}
|
||||||
cond = begin
|
cond = begin
|
||||||
\{{v}}
|
\{{v}}
|
||||||
end
|
end
|
||||||
if cond
|
if cond
|
||||||
tags.add(\{{k.id.stringify}})
|
tags.add(\{{k.id.symbolize}})
|
||||||
else
|
else
|
||||||
tags.delete(\{{k.id.stringify}})
|
tags.delete(\{{k.id.symbolize}})
|
||||||
end
|
end
|
||||||
\{% end %}
|
\{% end %}
|
||||||
tags
|
tags
|
||||||
|
|
|
@ -8,7 +8,7 @@ module Spectator
|
||||||
# but can be anything that should be iterated over when running the spec.
|
# but can be anything that should be iterated over when running the spec.
|
||||||
abstract class Node
|
abstract class Node
|
||||||
# User-defined keywords used for filtering and behavior modification.
|
# User-defined keywords used for filtering and behavior modification.
|
||||||
alias Tags = Set(String)
|
alias Tags = Set(Symbol)
|
||||||
|
|
||||||
# Location of the node in source code.
|
# Location of the node in source code.
|
||||||
getter! source : Source
|
getter! source : Source
|
||||||
|
|
Loading…
Reference in a new issue