class Entree::Runner

Constants

RUNNER_PATH

Attributes

output[R]

Public Class Methods

new(target) click to toggle source
# File lib/entree/runner.rb, line 6
def initialize(target)
  @target = target
end

Public Instance Methods

run() click to toggle source
# File lib/entree/runner.rb, line 10
def run
  @output = `phantomjs #{RUNNER_PATH} #{@target} WCAG2AA json`
  return if audit_success?

  if !phantomjs_installed?
    fail Entree::RunnerError.new("Please install PhantomJS. Visit http://phantomjs.org/ for instructions.")
  else
    fail Entree::RunnerError.new("PhantomJS exited without success: #{@output}")
  end
end

Private Instance Methods

audit_success?() click to toggle source
# File lib/entree/runner.rb, line 23
def audit_success?
  $?.success?
end
phantomjs_installed?() click to toggle source
# File lib/entree/runner.rb, line 27
def phantomjs_installed?
  $?.exitstatus != 127
end