module NoirTaggers

Defined in:

tagger/tagger.cr

Constant Summary

ENTRIES = begin {% if true %} [ {% for tagger in Tagger.all_subclasses.select(&.annotation(Noir::TaggerFor)).sort_by do |sub| (sub.annotation(Noir::TaggerFor))[:order] end %} {% ann = tagger.annotation(Noir::TaggerFor) %} Entry.new({{ ann[:key] }}, {{ ann[:name] }}, {{ ann[:desc] }}, {{ tagger.ancestors.includes?(FrameworkTagger) }}), {% end %} ] of Entry {% end %} end

Every annotated tagger, in order. Derived from the classes, so a tagger joins the registry by existing: the two hand-maintained hash literals this replaces were a second place to remember, where forgetting produced no error and no failing spec — just a tagger that never ran.

FRAMEWORK_ENTRIES = ENTRIES.select(&.framework)
PLAIN_ENTRIES = ENTRIES.reject(&.framework)

Class Method Summary

Class Method Detail

def self.available_tagger_names : Array(String) #

[View source]
def self.build(key : String, options : Hash(String, YAML::Any)) : Tagger | Nil #

Instantiates the tagger key names, or nil when nothing claims it.


[View source]
def self.framework_taggers : Array(Entry) #

[View source]
def self.run_tagger(endpoints : Array(Endpoint), options : Hash(String, YAML::Any), use_taggers : String) #

[View source]
def self.taggers : Array(Entry) #

[View source]
def self.target_techs(key : String) : Array(String) #

Techs a framework tagger declares an interest in; empty for plain taggers, which run against every endpoint.


[View source]
def self.unknown_tagger_names(use_taggers : String) : Array(String) #

[View source]
def self.validate_tagger_names!(use_taggers : String) #

[View source]