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