Sha256: 652964d7e092cb78390f172de7fc1646e181d4576882e8e27834fd659c01e046

Contents?: true

Size: 704 Bytes

Versions: 12

Compression:

Stored size: 704 Bytes

Contents

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

    def start
      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

12 entries across 12 versions & 2 rubygems

Version Path
tdiary-5.0.2 vendor/bundle/gems/jasmine-2.4.0/lib/jasmine/server.rb
jasmine-2.5.1 lib/jasmine/server.rb
jasmine-2.5.0 lib/jasmine/server.rb
tdiary-5.0.1 vendor/bundle/gems/jasmine-2.4.0/lib/jasmine/server.rb
jasmine-2.4.0 lib/jasmine/server.rb
jasmine-2.3.1 lib/jasmine/server.rb
jasmine-2.3.0 lib/jasmine/server.rb
jasmine-2.2.0 lib/jasmine/server.rb
jasmine-2.1.0 lib/jasmine/server.rb
jasmine-2.0.3 lib/jasmine/server.rb
jasmine-2.0.2 lib/jasmine/server.rb
jasmine-2.0.1 lib/jasmine/server.rb