| 205 | end |
| 206 | |
| 207 | def process |
| 208 | @process ||= begin |
| 209 | # extract any additional_args that start with -D as options |
| 210 | properties = @additional_args.dup - @additional_args.delete_if { |arg| arg[/^-D/] } |
| 211 | args = ['-jar', @jar, @role, '--port', @port.to_s] |
| 212 | server_command = [@java] + properties + args + @additional_args |
| 213 | cp = WebDriver::ChildProcess.build(*server_command) |
| 214 | |
| 215 | if @log.is_a?(String) |
| 216 | cp.io = @log |
| 217 | elsif @log |
| 218 | cp.io = :out |
| 219 | end |
| 220 | |
| 221 | cp.detach = @background |
| 222 | |
| 223 | cp |
| 224 | end |
| 225 | end |
| 226 | |
| 227 | def poll_for_ready |
| 228 | start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) |