Class: QUnited::Server
- Inherits:
-
Object
- Object
- QUnited::Server
- Defined in:
- lib/qunited/server.rb
Constant Summary collapse
- DEFAULT_PORT =
3040
- ASSETS_PATH =
File.('../server', __FILE__)
- SOURCE_FILE_PREFIX =
'qunited-source-file'
- TEST_FILE_PREFIX =
'qunited-test-file'
- QUNITED_ASSET_FILE_PREFIX =
'qunited-asset'
- COFFEESCRIPT_EXTENSIONS =
['coffee', 'cs']
Instance Attribute Summary collapse
-
#fixture_files ⇒ Object
Returns the value of attribute fixture_files.
-
#source_files ⇒ Object
Returns the value of attribute source_files.
-
#test_files ⇒ Object
Returns the value of attribute test_files.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Server
constructor
A new instance of Server.
- #start ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Server
Returns a new instance of Server.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/qunited/server.rb', line 21 def initialize(opts={}) @source_files = opts[:source_files] @test_files = opts[:test_files] @fixture_files = opts[:fixture_files] @port = opts[:port] || DEFAULT_PORT = { :Port => @port } unless opts[:verbose] [:AccessLog] = [] dev_null = '/dev/null' if File.exist?(dev_null) && File.writable?(dev_null) [:Logger] = WEBrick::Log.new(dev_null) end end @server = create_server() end |
Instance Attribute Details
#fixture_files ⇒ Object
Returns the value of attribute fixture_files.
19 20 21 |
# File 'lib/qunited/server.rb', line 19 def fixture_files @fixture_files end |
#source_files ⇒ Object
Returns the value of attribute source_files.
19 20 21 |
# File 'lib/qunited/server.rb', line 19 def source_files @source_files end |
#test_files ⇒ Object
Returns the value of attribute test_files.
19 20 21 |
# File 'lib/qunited/server.rb', line 19 def test_files @test_files end |
Instance Method Details
#start ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/qunited/server.rb', line 43 def start ['INT', 'TERM'].each do |signal| trap(signal) { @server.shutdown } end $stderr.puts "Serving QUnit test suite on port #{@port}\nCtrl-C to shutdown" @server.start end |