Sha256: 03dfb73124b826b6d18cd0e555e2e9926feea129350ec53760b8ab599ede05ff

Contents?: true

Size: 622 Bytes

Versions: 9

Compression:

Stored size: 622 Bytes

Contents

module Jasmine
  class Server
    def initialize(port = 8888, application = nil)
      @port = port
      @application = application
    end

    def start
      if Jasmine::Dependencies.legacy_rack?
        handler = Rack::Handler.get('webrick')
        handler.run(@application, :Port => @port, :AccessLog => [])
      else
        server = Rack::Server.new(: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

9 entries across 9 versions & 2 rubygems

Version Path
jasmine-2.0.0 lib/jasmine/server.rb
jasmine-2.0.0.rc5 lib/jasmine/server.rb
jasmine-2.0.0.rc4 lib/jasmine/server.rb
jasmine-2.0.0.rc3 lib/jasmine/server.rb
jasmine-2.0.0.rc2 lib/jasmine/server.rb
jasmine-multi_json-1.3.2.1 lib/jasmine/server.rb
jasmine-1.3.2 lib/jasmine/server.rb
jasmine-multi_json-1.3.1.1 lib/jasmine/server.rb
jasmine-1.3.1 lib/jasmine/server.rb