Class: AccessLint::Runner
- Inherits:
-
Object
- Object
- AccessLint::Runner
- Defined in:
- lib/access_lint/runner.rb
Constant Summary collapse
- RUNNER_PATH =
File.("../../../vendor/access-lint/bin/auditor.js", __FILE__)
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(target) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(target) ⇒ Runner
Returns a new instance of Runner.
6 7 8 |
# File 'lib/access_lint/runner.rb', line 6 def initialize(target) @target = target end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/access_lint/runner.rb', line 4 def output @output end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/access_lint/runner.rb', line 10 def run @output = `phantomjs #{RUNNER_PATH} #{@target}` return if audit_success? if !phantomjs_installed? raise AccessLint::RunnerError.new("Please install PhantomJS. Visit http://phantomjs.org/ for instructions.") else raise AccessLint::RunnerError.new("PhantomJS exited without success: #{@output}") end end |