From efd8150a553a3641df0100de4ab907004b2257da Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 14 Jul 2011 16:23:29 -0400 Subject: [PATCH] have runner tried to build qtwebkit widget if it's missing --- lib/jasmine/headless/runner.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/jasmine/headless/runner.rb b/lib/jasmine/headless/runner.rb index 04f9965..a9d48a0 100644 --- a/lib/jasmine/headless/runner.rb +++ b/lib/jasmine/headless/runner.rb @@ -22,7 +22,8 @@ module Jasmine 'src_files' => [] } - RUNNER = File.expand_path('../../../../ext/jasmine-webkit-specrunner/jasmine-webkit-specrunner', __FILE__) + RUNNER_DIR = File.expand_path('../../../../ext/jasmine-webkit-specrunner', __FILE__) + RUNNER = File.join(RUNNER_DIR, 'jasmine-webkit-specrunner') attr_reader :options @@ -32,7 +33,13 @@ module Jasmine end def initialize(options) - raise NoRunnerError if !File.file?(RUNNER) + if !File.file?(RUNNER) + $stderr.puts "No runner found, attempting to compile..." + Dir.chdir RUNNER_DIR do + system %{ruby extconf.rb} + end + raise NoRunnerError if !File.file?(RUNNER) + end @options = options end