Class: Warder::CoffeeLintRunner::LintRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/warder/coffee_lint_runner/lint_runner.rb

Overview

responsible for coffeelint results

Instance Method Summary collapse

Constructor Details

#initialize(file_or_path) ⇒ LintRunner

Returns a new instance of LintRunner.



8
9
10
# File 'lib/warder/coffee_lint_runner/lint_runner.rb', line 8

def initialize(file_or_path)
  @file_or_path = file_or_path
end

Instance Method Details

#resultObject



12
13
14
15
16
17
18
# File 'lib/warder/coffee_lint_runner/lint_runner.rb', line 12

def result
  if Dir.exist?(@file_or_path)
    Coffeelint.lint_dir(@file_or_path)
  else
    { @file_or_path => Coffeelint.lint_file(@file_or_path) }
  end
end