Module: Guard::Jstd::Runner

Extended by:
Forwardable
Defined in:
lib/guard/jstd/runner.rb

Class Method Summary collapse

Class Method Details

.java_commandObject



34
35
36
# File 'lib/guard/jstd/runner.rb', line 34

def java_command
  "java -jar #{java_path} --config #{jstd_config_path}"
end

.run(tests = "all") ⇒ Object



14
15
16
17
18
# File 'lib/guard/jstd/runner.rb', line 14

def run(tests="all")
  UI.info("Running #{tests}")
  results = `#{java_command} --tests #{tests}`
  Formatter.notify(results)
end

.start_serverObject



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/guard/jstd/runner.rb', line 20

def start_server
  if Configuration.start_server
    browser_opt = Configuration.capture_browser ?
                  " --browser #{browser_paths}" : ""
    pid = fork {
      trap('QUIT', 'IGNORE')
      trap('TSTP', 'IGNORE')
      `#{java_command} --port #{server_port}#{browser_opt}`
    }
    Process.detach(pid)
    UI.info "JsTestDriver server started on port #{server_port}"
  end
end