Class: JSHint4r::Reporter::Compilation

Inherits:
Object
  • Object
show all
Includes:
JSHint4r::Reporter
Defined in:
lib/jshint4r/reporter/compilation.rb

Instance Method Summary collapse

Methods included from JSHint4r::Reporter

#key_symbolize

Instance Method Details

#report(target, errors, verbose = false) ⇒ Object

param

String target

param

Array errors

return

String or nil



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/jshint4r/reporter/compilation.rb', line 11

def report( target, errors, verbose = false )
  if errors and errors.size > 0
    errors.map { |error|
      e = key_symbolize( error )
      sprintf( "%s:%s:%s: %s\n%s",
               target,
               e[:line], e[:character], e[:reason], e[:evidence] )
    }.join("\n") << "\n"
  elsif verbose
    sprintf( "%s ... ok\n", target )
  end
end