Class: I18n::Tasks::Scanners::RubyAstScanner

Inherits:
FileScanner show all
Includes:
AST::Sexp, RelativeKeys
Defined in:
lib/i18n/tasks/scanners/ruby_ast_scanner.rb

Overview

Scan for I18n.translate calls using whitequark/parser

Direct Known Subclasses

ErbAstScanner

Constant Summary collapse

MAGIC_COMMENT_PREFIX =
/\A.\s*i18n-tasks-use\s+/.freeze

Instance Attribute Summary

Attributes inherited from FileScanner

#config

Instance Method Summary collapse

Methods included from RelativeKeys

#absolute_key

Methods inherited from FileScanner

#keys

Methods inherited from Scanner

#keys

Constructor Details

#initialize(**args) ⇒ RubyAstScanner

Returns a new instance of RubyAstScanner.



19
20
21
22
23
24
# File 'lib/i18n/tasks/scanners/ruby_ast_scanner.rb', line 19

def initialize(**args)
  super(**args)
  @parser = ::Parser::CurrentRuby.new
  @magic_comment_parser = ::Parser::CurrentRuby.new
  @matchers = setup_matchers
end