Class: Specjour::Dispatcher
- Inherits:
-
Object
- Object
- Specjour::Dispatcher
- Includes:
- SocketHelper
- Defined in:
- lib/specjour/dispatcher.rb
Instance Attribute Summary collapse
-
#drb_connection_errors ⇒ Object
readonly
Returns the value of attribute drb_connection_errors.
-
#hosts ⇒ Object
readonly
Returns the value of attribute hosts.
-
#manager_threads ⇒ Object
readonly
Returns the value of attribute manager_threads.
-
#managers ⇒ Object
readonly
Returns the value of attribute managers.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#project_path ⇒ Object
Returns the value of attribute project_path.
-
#rsync_port ⇒ Object
readonly
Returns the value of attribute rsync_port.
-
#test_paths ⇒ Object
readonly
Returns the value of attribute test_paths.
-
#worker_size ⇒ Object
Returns the value of attribute worker_size.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Dispatcher
constructor
A new instance of Dispatcher.
- #start ⇒ Object
Methods included from SocketHelper
#current_uri, #hostname, #ip_from_hostname, #local_ip, #new_uri
Constructor Details
#initialize(options = {}) ⇒ Dispatcher
Returns a new instance of Dispatcher.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/specjour/dispatcher.rb', line 10 def initialize( = {}) Specjour.load_custom_hooks @options = @project_path = [:project_path] @test_paths = [:test_paths] @worker_size = 0 @managers = [] @drb_connection_errors = Hash.new(0) @rsync_port = [:rsync_port] @manager_threads = [] end |
Instance Attribute Details
#drb_connection_errors ⇒ Object (readonly)
Returns the value of attribute drb_connection_errors.
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def drb_connection_errors @drb_connection_errors end |
#hosts ⇒ Object (readonly)
Returns the value of attribute hosts.
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def hosts @hosts end |
#manager_threads ⇒ Object (readonly)
Returns the value of attribute manager_threads.
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def manager_threads @manager_threads end |
#managers ⇒ Object (readonly)
Returns the value of attribute managers.
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def managers @managers end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def @options end |
#project_path ⇒ Object
Returns the value of attribute project_path.
8 9 10 |
# File 'lib/specjour/dispatcher.rb', line 8 def project_path @project_path end |
#rsync_port ⇒ Object (readonly)
Returns the value of attribute rsync_port.
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def rsync_port @rsync_port end |
#test_paths ⇒ Object (readonly)
Returns the value of attribute test_paths.
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def test_paths @test_paths end |
#worker_size ⇒ Object
Returns the value of attribute worker_size.
8 9 10 |
# File 'lib/specjour/dispatcher.rb', line 8 def worker_size @worker_size end |
Instance Method Details
#start ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/specjour/dispatcher.rb', line 22 def start abort("#{project_path} doesn't exist") unless File.directory?(project_path) gather_managers rsync_daemon.start dispatch_work if dispatching_tests? printer.start else wait_on_managers end exit printer.exit_status end |