Class: I18nLinter::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_linter/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(options, config) ⇒ Runner

Returns a new instance of Runner.



9
10
11
12
# File 'lib/i18n_linter/runner.rb', line 9

def initialize(options, config)
  @options = options
  @linter = I18nLinter.linter.new(options, config)
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/i18n_linter/runner.rb', line 14

def run
  $stdout = StringIO.new

  result = @options.files.map { |file|
    lint_result = lint(file)
    if lint_result.success?
      true
    else
      @linter.show_errors(lint_result)
      false
    end
  }.all?

  handle_results

  $stdout = STDOUT

  result
end