Module: Terminus

Extended by:
Forwardable
Defined in:
lib/terminus.rb,
lib/terminus/host.rb,
lib/terminus/node.rb,
lib/terminus/proxy.rb,
lib/terminus/client.rb,
lib/terminus/server.rb,
lib/terminus/browser.rb,
lib/terminus/headers.rb,
lib/terminus/timeouts.rb,
lib/terminus/connector.rb,
lib/terminus/controller.rb,
lib/terminus/application.rb,
lib/terminus/proxy/rewrite.rb,
lib/terminus/client/browser.rb,
lib/terminus/proxy/external.rb,
lib/terminus/client/phantomjs.rb,
lib/terminus/proxy/driver_body.rb

Defined Under Namespace

Modules: Client, Timeouts Classes: Application, Browser, Connector, Controller, Headers, Host, Node, ObsoleteElementError, Proxy, Server

Constant Summary collapse

FAYE_MOUNT =
'/messaging'
DEFAULT_HOST =
'127.0.0.1'
DEFAULT_PORT =
7004
LOCALHOST =
/^(localhost|0\.0\.0\.0|127\.0\.0\.1)$/
PING_PATH =
'/favicon.ico'
RETRY_LIMIT =
3
ROOT =
File.expand_path('..', __FILE__)

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.debugObject

Returns the value of attribute debug.



47
48
49
# File 'lib/terminus.rb', line 47

def debug
  @debug
end

.socketsObject

Returns the value of attribute sockets.



47
48
49
# File 'lib/terminus.rb', line 47

def sockets
  @sockets
end

Class Method Details

.create(options = {}) ⇒ Object



49
50
51
# File 'lib/terminus.rb', line 49

def create(options = {})
  Server.new(options)
end

.endpoint(host = DEFAULT_HOST) ⇒ Object



53
54
55
# File 'lib/terminus.rb', line 53

def endpoint(host = DEFAULT_HOST)
  "http://#{host}:#{port}#{FAYE_MOUNT}"
end

.ensure_reactor_runningObject



57
58
59
60
# File 'lib/terminus.rb', line 57

def ensure_reactor_running
  Thread.new { EM.run unless EM.reactor_running? }
  Thread.pass until EM.reactor_running?
end

.portObject



62
63
64
# File 'lib/terminus.rb', line 62

def port
  @port || DEFAULT_PORT
end

.port=(port) ⇒ Object



66
67
68
# File 'lib/terminus.rb', line 66

def port=(port)
  @port = port.to_i
end

.start_browser(options = {}) ⇒ Object



70
71
72
# File 'lib/terminus.rb', line 70

def start_browser(options = {})
  Client::Browser.start(options)
end

.start_phantomjs(options = {}) ⇒ Object



74
75
76
# File 'lib/terminus.rb', line 74

def start_phantomjs(options = {})
  Client::PhantomJS.start(options)
end