Class: ThemeCheck::HtmlVisitor
- Inherits:
-
Object
- Object
- ThemeCheck::HtmlVisitor
- Includes:
- RegexHelpers
- Defined in:
- lib/theme_check/html_visitor.rb
Constant Summary
Constants included from RegexHelpers
RegexHelpers::HTML_LIQUID_PLACEHOLDER, RegexHelpers::LIQUID_TAG, RegexHelpers::LIQUID_TAG_OR_VARIABLE, RegexHelpers::LIQUID_VARIABLE, RegexHelpers::START_OR_END_QUOTE
Instance Attribute Summary collapse
-
#checks ⇒ Object
readonly
Returns the value of attribute checks.
Instance Method Summary collapse
-
#initialize(checks) ⇒ HtmlVisitor
constructor
A new instance of HtmlVisitor.
- #visit_liquid_file(liquid_file) ⇒ Object
Methods included from RegexHelpers
Constructor Details
#initialize(checks) ⇒ HtmlVisitor
Returns a new instance of HtmlVisitor.
10 11 12 |
# File 'lib/theme_check/html_visitor.rb', line 10 def initialize(checks) @checks = checks end |
Instance Attribute Details
#checks ⇒ Object (readonly)
Returns the value of attribute checks.
8 9 10 |
# File 'lib/theme_check/html_visitor.rb', line 8 def checks @checks end |
Instance Method Details
#visit_liquid_file(liquid_file) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/theme_check/html_visitor.rb', line 14 def visit_liquid_file(liquid_file) doc, placeholder_values = parse(liquid_file) visit(HtmlNode.new(doc, liquid_file, placeholder_values)) rescue ArgumentError => e call_checks(:on_parse_error, e, liquid_file) end |