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
|
||||
tags = _spectator_tags
|
||||
\{% if !tags.empty? %}
|
||||
tags.concat({ \{{tags.map(&.id.stringify).splat}} })
|
||||
tags.concat({ \{{tags.map(&.id.symbolize).splat}} })
|
||||
\{% end %}
|
||||
\{% for k, v in metadata %}
|
||||
cond = begin
|
||||
\{{v}}
|
||||
end
|
||||
if cond
|
||||
tags.add(\{{k.id.stringify}})
|
||||
tags.add(\{{k.id.symbolize}})
|
||||
else
|
||||
tags.delete(\{{k.id.stringify}})
|
||||
tags.delete(\{{k.id.symbolize}})
|
||||
end
|
||||
\{% end %}
|
||||
tags
|
||||
|
|
|
@ -20,16 +20,16 @@ module Spectator::DSL
|
|||
def self._spectator_tags
|
||||
tags = super
|
||||
\{% if !tags.empty? %}
|
||||
tags.concat({ \{{tags.map(&.id.stringify).splat}} })
|
||||
tags.concat({ \{{tags.map(&.id.symbolize).splat}} })
|
||||
\{% end %}
|
||||
\{% for k, v in metadata %}
|
||||
cond = begin
|
||||
\{{v}}
|
||||
end
|
||||
if cond
|
||||
tags.add(\{{k.id.stringify}})
|
||||
tags.add(\{{k.id.symbolize}})
|
||||
else
|
||||
tags.delete(\{{k.id.stringify}})
|
||||
tags.delete(\{{k.id.symbolize}})
|
||||
end
|
||||
\{% end %}
|
||||
tags
|
||||
|
|
|
@ -8,7 +8,7 @@ module Spectator
|
|||
# but can be anything that should be iterated over when running the spec.
|
||||
abstract class Node
|
||||
# User-defined keywords used for filtering and behavior modification.
|
||||
alias Tags = Set(String)
|
||||
alias Tags = Set(Symbol)
|
||||
|
||||
# Location of the node in source code.
|
||||
getter! source : Source
|
||||
|
|
Loading…
Reference in a new issue