Sha256: e4d728869eef7c2d44a5d1562a4a03d978cc3bf669047e42643eaaa68d47654f
Contents?: true
Size: 764 Bytes
Versions: 6
Compression:
Stored size: 764 Bytes
Contents
module Jasmine class Server def initialize(port = 8888, application = nil, rack_options = nil, env = ENV) @port = port @application = application @rack_options = rack_options || {} @env = env end def start @env['PORT'] = @port.to_s if Jasmine::Dependencies.legacy_rack? handler = Rack::Handler.get('webrick') handler.run(@application, :Port => @port, :AccessLog => []) else server = Rack::Server.new(@rack_options.merge(:Port => @port, :AccessLog => [])) # workaround for Rack bug, when Rack > 1.2.1 is released Rack::Server.start(:app => Jasmine.app(self)) will work server.instance_variable_set(:@app, @application) server.start end end end end
Version data entries
6 entries across 4 versions & 2 rubygems