Class: A11y::Lint::ErbRunner
- Inherits:
-
Object
- Object
- A11y::Lint::ErbRunner
- Defined in:
- lib/a11y/lint/erb_runner.rb
Overview
Parses ERB templates and checks them against accessibility rules.
Constant Summary collapse
- ERB_TAG =
/<%.*?%>/m- ERB_OUTPUT_TAG =
/<%=\s*(.*?)\s*-?%>/m- VOID_ELEMENTS =
%w[ area base br col embed hr img input link meta param source track wbr ].freeze
Instance Method Summary collapse
-
#initialize(rules) ⇒ ErbRunner
constructor
A new instance of ErbRunner.
- #run(source, filename:) ⇒ Object
Constructor Details
#initialize(rules) ⇒ ErbRunner
Returns a new instance of ErbRunner.
16 17 18 |
# File 'lib/a11y/lint/erb_runner.rb', line 16 def initialize(rules) @rules = rules end |
Instance Method Details
#run(source, filename:) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/a11y/lint/erb_runner.rb', line 20 def run(source, filename:) @filename = filename @offenses = [] check_html_nodes(source) (source) @offenses end |