Module: ThemeCheck::ShopifyLiquid::Tag
Instance Method Summary collapse
Instance Method Details
#labels ⇒ Object
9 10 11 12 |
# File 'lib/theme_check/shopify_liquid/tag.rb', line 9 def labels @tags ||= YAML.load(File.read("#{__dir__}/../../../data/shopify_liquid/tags.yml")) .to_set end |
#liquid_tag_regex(tag) ⇒ Object
20 21 22 23 24 |
# File 'lib/theme_check/shopify_liquid/tag.rb', line 20 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
14 15 16 17 18 |
# File 'lib/theme_check/shopify_liquid/tag.rb', line 14 def tag_regex(tag) return unless labels.include?(tag) @tag_regexes ||= {} @tag_regexes[tag] ||= /\A#{Liquid::TagStart}-?\s*#{tag}/m end |