Class: HamlI18nLint::Runner

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

Overview

Run lint and report the result.

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Runner

Returns new runner to run lint with given options.

Parameters:



8
9
10
11
12
# 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

Instance Method Details

#runtrue, false

Run lint and report the result

Returns:

  • (true, false)

    all of the files passed lint or not.



16
17
18
19
20
21
22
23
24
25
26
27
# 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