Class: Specjour::Dispatcher
- Inherits:
-
Object
- Object
- Specjour::Dispatcher
- Includes:
- SocketHelper
- Defined in:
- lib/specjour/dispatcher.rb
Instance Attribute Summary (collapse)
-
- (Object) drb_connection_errors
readonly
Returns the value of attribute drb_connection_errors.
-
- (Object) hosts
readonly
Returns the value of attribute hosts.
-
- (Object) manager_threads
readonly
Returns the value of attribute manager_threads.
-
- (Object) managers
readonly
Returns the value of attribute managers.
-
- (Object) options
readonly
Returns the value of attribute options.
-
- (Object) project_path
Returns the value of attribute project_path.
-
- (Object) rsync_port
readonly
Returns the value of attribute rsync_port.
-
- (Object) test_paths
readonly
Returns the value of attribute test_paths.
-
- (Object) worker_size
Returns the value of attribute worker_size.
Instance Method Summary (collapse)
-
- (Dispatcher) initialize(options = {})
constructor
A new instance of Dispatcher.
- - (Object) start
Methods included from SocketHelper
#current_uri, #hostname, #ip_from_hostname, #new_uri
Constructor Details
- (Dispatcher) initialize(options = {})
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
- (Object) drb_connection_errors (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 |
- (Object) hosts (readonly)
Returns the value of attribute hosts
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def hosts @hosts end |
- (Object) manager_threads (readonly)
Returns the value of attribute manager_threads
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def manager_threads @manager_threads end |
- (Object) managers (readonly)
Returns the value of attribute managers
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def managers @managers end |
- (Object) options (readonly)
Returns the value of attribute options
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def @options end |
- (Object) project_path
Returns the value of attribute project_path
8 9 10 |
# File 'lib/specjour/dispatcher.rb', line 8 def project_path @project_path end |
- (Object) rsync_port (readonly)
Returns the value of attribute rsync_port
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def rsync_port @rsync_port end |
- (Object) test_paths (readonly)
Returns the value of attribute test_paths
7 8 9 |
# File 'lib/specjour/dispatcher.rb', line 7 def test_paths @test_paths end |
- (Object) worker_size
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
- (Object) start
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 |