Class: Culerity::CelerityServer
- Inherits:
-
Object
- Object
- Culerity::CelerityServer
- Defined in:
- lib/culerity/celerity_server.rb
Instance Method Summary collapse
- #extract_js_strack_trace(e) ⇒ Object
-
#initialize(_in, _out) ⇒ CelerityServer
constructor
A new instance of CelerityServer.
Constructor Details
#initialize(_in, _out) ⇒ CelerityServer
Returns a new instance of CelerityServer.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/culerity/celerity_server.rb', line 8 def initialize(_in, _out) @proxies = {} @browsers = [] while(true) call, block = eval _in.gets.to_s.strip return if call == "_exit_" next(close_browsers) if call == "_close_browsers_" next(clear_proxies) if call == "_clear_proxies_" unless call.nil? begin result = target(call.first).send call[1], *call[2..-1], &block _out << "[:return, #{proxify result}]\n" rescue => e _out << "[:exception, \"#{e.class.name}\", #{e..inspect}, #{prepend_js_stack_trace(e).inspect}]\n" end end end end |
Instance Method Details
#extract_js_strack_trace(e) ⇒ Object
82 83 84 85 86 87 88 89 90 |
# File 'lib/culerity/celerity_server.rb', line 82 def extract_js_strack_trace(e) if e.respond_to?(:getScriptStackTrace) e.getScriptStackTrace elsif e.respond_to?(:cause) && e.cause extract_js_strack_trace e.cause else "" end end |