Class: Steam::Browser::HtmlUnit::Drb
- Inherits:
-
Object
- Object
- Steam::Browser::HtmlUnit::Drb
- Defined in:
- lib/steam/browser/html_unit/drb.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#process ⇒ Object
readonly
Returns the value of attribute process.
Instance Method Summary collapse
- #daemonize ⇒ Object
-
#initialize(connection, options = {}) ⇒ Drb
constructor
A new instance of Drb.
- #method_missing(method, *args, &block) ⇒ Object
- #object ⇒ Object
- #restart ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(connection, options = {}) ⇒ Drb
Returns a new instance of Drb.
9 10 11 12 13 14 15 |
# File 'lib/steam/browser/html_unit/drb.rb', line 9 def initialize(connection, = {}) @connection, @options = connection, @process = Steam::Process.new process.kill if [:restart] && process.running? [:daemon] ? daemonize : start unless process.running? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
39 40 41 |
# File 'lib/steam/browser/html_unit/drb.rb', line 39 def method_missing(method, *args, &block) object.send(method, *args, &block) end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
7 8 9 |
# File 'lib/steam/browser/html_unit/drb.rb', line 7 def connection @connection end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/steam/browser/html_unit/drb.rb', line 7 def @options end |
#process ⇒ Object (readonly)
Returns the value of attribute process.
7 8 9 |
# File 'lib/steam/browser/html_unit/drb.rb', line 7 def process @process end |
Instance Method Details
#daemonize ⇒ Object
21 22 23 24 25 |
# File 'lib/steam/browser/html_unit/drb.rb', line 21 def daemonize [:keep_alive] = true unless .key?(:keep_alive) process.fork() { start } sleep(1) # FIXME end |
#object ⇒ Object
17 18 19 |
# File 'lib/steam/browser/html_unit/drb.rb', line 17 def object @object ||= DRbObject.new(nil, Steam.config[:drb_uri]) end |
#restart ⇒ Object
34 35 36 37 |
# File 'lib/steam/browser/html_unit/drb.rb', line 34 def restart process.kill if process.running? daemonize end |