Class: Spinoff::Server::JRuby
- Defined in:
- lib/spinoff/server/jruby.rb
Instance Attribute Summary
Attributes inherited from Generic
Instance Method Summary collapse
Methods inherited from Generic
#accept_loop, #disconnect_client, #init_script, #initialize, start
Constructor Details
This class inherits a constructor from Spinoff::Server::Generic
Instance Method Details
#start ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/spinoff/server/jruby.rb', line 12 def start accept_loop do |files| start = Time.now STDERR.puts "Creating JRuby scripting container" context = ScriptingContainer.new(LocalContextScope::SINGLETHREAD) if File.exist?(init_script) sec = Benchmark.realtime do context.run_scriptlet(PathType::ABSOLUTE, init_script) end STDERR.puts "Loaded init script in %.4fs (%s)" % [sec, init_script] else STDERR.puts "WARNING: Init script '#{init_script}' does not exist!" end STDERR.puts "Loading #{files.inspect}" context.put('framework', config[:test_framework]) context.put('files', files) context.run_scriptlet <<-__RUBY require 'spinoff/test_runner' runner = Spinoff::TestRunner.init(framework) runner << files __RUBY context.terminate STDERR.puts "Execution time: %.4fs" % (Time.now - start) end end |