Module: BetterHtml::BetterErb::RuntimeChecks

Included in:
ErubiImplementation, ErubisImplementation
Defined in:
lib/better_html/better_erb/runtime_checks.rb

Instance Method Summary collapse

Instance Method Details

#initialize(erb, config: BetterHtml.config, **options) ⇒ Object



6
7
8
9
10
# File 'lib/better_html/better_erb/runtime_checks.rb', line 6

def initialize(erb, config: BetterHtml.config, **options)
  @parser = HtmlTokenizer::Parser.new
  @config = config
  super(erb, **options)
end

#validate!Object



12
13
14
15
16
17
18
# File 'lib/better_html/better_erb/runtime_checks.rb', line 12

def validate!
  check_parser_errors

  unless @parser.context == :none
    raise BetterHtml::HtmlError, 'Detected an open tag at the end of this document.'
  end
end