class HamlI18nLint::Runner
Run lint and report the result.
Public Class Methods
new(options)
click to toggle source
@param options [Options] options @return [Runner] new runner to run lint with given options
# File lib/haml_i18n_lint/runner.rb, line 8 def initialize(options) @options = options @config = ::HamlI18nLint::Config.new(@options) @linter = HamlI18nLint.linter.new(@config) end
Public Instance Methods
run()
click to toggle source
Run lint and report the result @return [true, false] all of the files passed lint or not.
# File lib/haml_i18n_lint/runner.rb, line 16 def run @config.files.map do |file| result = lint(file) if result.success? true else @config.report(result) false end end.all? end
Private Instance Methods
lint(filename)
click to toggle source
# File lib/haml_i18n_lint/runner.rb, line 31 def lint(filename) template = File.read(filename) @linter.lint(filename: filename, template: template) end