Class: I18n::Processes::Scanners::RubyAstScanner
- Inherits:
-
FileScanner
- Object
- Scanner
- FileScanner
- I18n::Processes::Scanners::RubyAstScanner
- Includes:
- AST::Sexp, RelativeKeys
- Defined in:
- lib/i18n/processes/scanners/ruby_ast_scanner.rb
Overview
Scan for I18n.translate calls using whitequark/parser
Constant Summary collapse
- MAGIC_COMMENT_PREFIX =
/\A.\s*i18n-processes-use\s+/
- RECEIVER_MESSAGES =
[nil, AST::Node.new(:const, [nil, :I18n])].product(i[t translate])
Instance Attribute Summary
Attributes inherited from FileScanner
Instance Method Summary collapse
-
#initialize(**args) ⇒ RubyAstScanner
constructor
A new instance of RubyAstScanner.
Methods included from RelativeKeys
Methods inherited from FileScanner
Methods inherited from Scanner
Constructor Details
#initialize(**args) ⇒ RubyAstScanner
Returns a new instance of RubyAstScanner.
20 21 22 23 24 25 26 27 |
# File 'lib/i18n/processes/scanners/ruby_ast_scanner.rb', line 20 def initialize(**args) super(args) @parser = ::Parser::CurrentRuby.new @magic_comment_parser = ::Parser::CurrentRuby.new @call_finder = RubyAstCallFinder.new( receiver_messages: config[:receiver_messages] || RECEIVER_MESSAGES ) end |