Class: I18nLinter::Linter
- Inherits:
-
Object
- Object
- I18nLinter::Linter
- Defined in:
- lib/i18n_linter/linter.rb
Instance Method Summary collapse
-
#initialize(options, config) ⇒ Linter
constructor
A new instance of Linter.
- #lint(filename:, file:) ⇒ Object
- #show_errors(results) ⇒ Object
Constructor Details
#initialize(options, config) ⇒ Linter
Returns a new instance of Linter.
8 9 10 11 12 |
# File 'lib/i18n_linter/linter.rb', line 8 def initialize(, config) @options = @config = config @strings = [] end |
Instance Method Details
#lint(filename:, file:) ⇒ Object
14 15 16 17 18 |
# File 'lib/i18n_linter/linter.rb', line 14 def lint(filename:, file:) parsed_file = tokenize_file(filename, file) find_strings(filename, parsed_file) compile(filename) end |
#show_errors(results) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/i18n_linter/linter.rb', line 20 def show_errors(results) puts results.each do |result| file = File.readlines(result.filename) line = result.line print_block(result, file, line) end puts end |