Module: Terminus
- Extended by:
- Forwardable
- Defined in:
- lib/terminus/connector/server.rb,
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,
lib/terminus/connector/socket_handler.rb
Overview
Based on code from the Poltergeist project github.com/jonleighton/poltergeist
Copyright © 2011 Jonathan Leighton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Defined Under Namespace
Modules: Client, Connector, Timeouts Classes: Application, Browser, Controller, Headers, Host, Node, ObsoleteElementError, Proxy, Server
Constant Summary collapse
- FAYE_MOUNT =
'/messaging'
- DEFAULT_HOST =
'localhost'
- DEFAULT_PORT =
7004
- LOCALHOST =
/^(localhost|0\.0\.0\.0|127\.0\.0\.1)$/
- PING_PATH =
'/favicon.ico'
- RETRY_LIMIT =
3
- ROOT =
File.('..', __FILE__)
Class Attribute Summary collapse
-
.debug ⇒ Object
Returns the value of attribute debug.
-
.sockets ⇒ Object
Returns the value of attribute sockets.
Class Method Summary collapse
- .create(options = {}) ⇒ Object
- .endpoint(host = DEFAULT_HOST) ⇒ Object
- .ensure_reactor_running ⇒ Object
- .port ⇒ Object
- .port=(port) ⇒ Object
- .start_browser(options = {}) ⇒ Object
- .start_phantomjs(options = {}) ⇒ Object
Class Attribute Details
.debug ⇒ Object
Returns the value of attribute debug.
46 47 48 |
# File 'lib/terminus.rb', line 46 def debug @debug end |
.sockets ⇒ Object
Returns the value of attribute sockets.
46 47 48 |
# File 'lib/terminus.rb', line 46 def sockets @sockets end |
Class Method Details
.create(options = {}) ⇒ Object
48 49 50 |
# File 'lib/terminus.rb', line 48 def create( = {}) Server.new() end |
.endpoint(host = DEFAULT_HOST) ⇒ Object
52 53 54 |
# File 'lib/terminus.rb', line 52 def endpoint(host = DEFAULT_HOST) "http://#{host}:#{port}#{FAYE_MOUNT}" end |
.ensure_reactor_running ⇒ Object
56 57 58 59 |
# File 'lib/terminus.rb', line 56 def ensure_reactor_running Thread.new { EM.run unless EM.reactor_running? } Thread.pass until EM.reactor_running? end |
.port ⇒ Object
61 62 63 |
# File 'lib/terminus.rb', line 61 def port @port || DEFAULT_PORT end |
.port=(port) ⇒ Object
65 66 67 |
# File 'lib/terminus.rb', line 65 def port=(port) @port = port.to_i end |