Class: I18nLinter::Runner
- Inherits:
-
Object
- Object
- I18nLinter::Runner
- Defined in:
- lib/i18n_linter/runner.rb
Instance Method Summary collapse
-
#initialize(options, config) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
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(, config) @options = @linter = I18nLinter.linter.new(, config) end |
Instance Method Details
#run ⇒ Object
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 |