Class: I18n::Tasks::Scanners::ErbAstScanner

Inherits:
RubyScanner show all
Includes:
OccurrenceFromPosition
Defined in:
lib/i18n/tasks/scanners/erb_ast_scanner.rb

Overview

Scan for I18n.translate calls in ERB-file using regexp and Parser/Prism

Constant Summary collapse

DEFAULT_REGEXP =
/<%(={1,2}|-|\#-?|%)?(.*?)([-=])?%>/m

Constants inherited from RubyScanner

RubyScanner::MAGIC_COMMENT_PREFIX, RubyScanner::MAGIC_COMMENT_SKIP_PRISM

Constants included from Logging

Logging::MUTEX, Logging::PROGRAM_NAME

Instance Attribute Summary

Attributes inherited from FileScanner

#config

Instance Method Summary collapse

Methods included from OccurrenceFromPosition

#occurrence_from_position

Methods included from Logging

log_error, log_stderr, log_verbose, log_warn, program_name, warn_deprecated

Methods included from RelativeKeys

#absolute_key

Methods inherited from FileScanner

#initialize, #keys

Methods inherited from Scanner

#keys

Constructor Details

This class inherits a constructor from I18n::Tasks::Scanners::FileScanner

Instance Method Details

#ast_parser_parse_file(path) ⇒ Object

Parser scanner, method called in RubyScanner



16
17
18
19
# File 'lib/i18n/tasks/scanners/erb_ast_scanner.rb', line 16

def ast_parser_parse_file(path)
  @ruby_parser ||= LocalRubyParser.new(ignore_blocks: true)
  super
end