Class: LoadRunner::ServerBase

Inherits:
Sinatra::Application
  • Object
show all
Defined in:
lib/load_runner/server_base.rb

Overview

The base class for the sinatra server. Initialize what we can here, but since there are values that will become known only later, the #prepare method is provided.

Direct Known Subclasses

Server

Class Method Summary collapse

Class Method Details

.prepare(opts = {}) ⇒ Object

Since we cannot use any config values in the main body of the class, since they will be updated later, we need to set anything that relys on the config values just before running the server. The CommandLine class and the test suite should both call ‘Server.prepare` before calling Server.run!



26
27
28
29
# File 'lib/load_runner/server_base.rb', line 26

def self.prepare(opts={})
  set :bind, opts[:bind] || '0.0.0.0'
  set :port, opts[:port] || '3000'
end