Class: JSHint4r::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/jshint4r/source.rb

Constant Summary collapse

JSHINT =
File.dirname(__FILE__) + '/../../vendor/jshint/jshint.js'
RUNNER =
File.dirname(__FILE__) + '/jshint_runner.js'

Class Method Summary collapse

Class Method Details

.contextObject

return

ExecJS::*::Context



17
18
19
20
21
22
23
# File 'lib/jshint4r/source.rb', line 17

def context
  if ( !@context )
    @context = ExecJS.compile( src )
  end

  @context
end

.srcObject

return

String



10
11
12
# File 'lib/jshint4r/source.rb', line 10

def src
  [JSHINT, RUNNER].map { |f| File.read(f) }.join
end