Permalink
Browse files

don't reinvent the wheel

  • Loading branch information...
1 parent f51f041 commit d3c3e7bd7dc59515999af664420eb79ce9e71cc5 @johnbintz committed Jan 13, 2012
Showing with 2 additions and 12 deletions.
  1. +2 −12 lib/jasmine/headless/runner.rb
@@ -125,24 +125,14 @@ def files_list
end
def wrap_in_server
- require 'rack'
require 'webrick'
require 'thread'
+ require 'rack'
require 'net/http'
server = Thread.new do
- responder = lambda do |env|
- file = Pathname(env['PATH_INFO'])
-
- if file.file?
- [ 200, { 'Content-Type' => 'text/html' }, [ file.read ] ]
- else
- [ 404, {}, [ 'Not found' ] ]
- end
- end
-
Rack::Handler::WEBrick.run(
- responder,
+ Rack::File.new('/'),
:Port => server_port,
:Logger => Logger.new(StringIO.new),
:AccessLog => [

0 comments on commit d3c3e7b

Please sign in to comment.