Module: PlatformosCheck::PlatformosLiquid::Tag
Constant Summary collapse
- LABELS_NOT_IN_SOURCE_INDEX =
%w[elsif ifchanged catch ensure when]
Instance Method Summary collapse
Instance Method Details
#end_labels ⇒ Object
18 19 20 21 22 |
# File 'lib/platformos_check/platformos_liquid/tag.rb', line 18 def end_labels @end_labels ||= .select { |x| x.is_a?(Hash) } .map { |x| x.values[0] } end |
#labels ⇒ Object
12 13 14 15 16 |
# File 'lib/platformos_check/platformos_liquid/tag.rb', line 12 def labels @labels ||= .map { |x| to_label(x) } .to_set end |
#liquid_tag_regex(tag) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/platformos_check/platformos_liquid/tag.rb', line 31 def liquid_tag_regex(tag) return unless labels.include?(tag) @tag_liquid_regexes ||= {} @tag_liquid_regexes[tag] ||= /^\s*#{tag}/m end |
#tag_regex(tag) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/platformos_check/platformos_liquid/tag.rb', line 24 def tag_regex(tag) return unless labels.include?(tag) @tag_regexes ||= {} @tag_regexes[tag] ||= /\A#{Liquid::TagStart}-?\s*#{tag}/m end |