Class: Jasmine::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/jasmine/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(port = 8888, application = nil, rack_options = nil, env = ENV) ⇒ Server

Returns a new instance of Server.



3
4
5
6
7
8
# File 'lib/jasmine/server.rb', line 3

def initialize(port = 8888, application = nil, rack_options = nil, env = ENV)
  @port = port
  @application = application
  @rack_options = rack_options || {}
  @env = env
end

Instance Method Details

#startObject



10
11
12
13
14
15
# File 'lib/jasmine/server.rb', line 10

def start
  @env['PORT'] = @port.to_s
  Rack::Server.start(@rack_options.merge(:Port => @port,
                                         :AccessLog => [],
                                         :app => @application))
end