Class: RSpecQueue::Configuration
- Inherits:
-
Object
- Object
- RSpecQueue::Configuration
- Includes:
- Singleton
- Defined in:
- lib/rspec_queue/configuration.rb
Instance Attribute Summary collapse
-
#after_worker_spawn_block ⇒ Object
Returns the value of attribute after_worker_spawn_block.
-
#server_socket ⇒ Object
Returns the value of attribute server_socket.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#after_worker_spawn_block ⇒ Object
Returns the value of attribute after_worker_spawn_block.
7 8 9 |
# File 'lib/rspec_queue/configuration.rb', line 7 def after_worker_spawn_block @after_worker_spawn_block end |
#server_socket ⇒ Object
Returns the value of attribute server_socket.
8 9 10 |
# File 'lib/rspec_queue/configuration.rb', line 8 def server_socket @server_socket end |
Class Method Details
.after_worker_spawn(&block) ⇒ Object
10 11 12 |
# File 'lib/rspec_queue/configuration.rb', line 10 def self.after_worker_spawn(&block) self.instance.after_worker_spawn_block = block end |
.call_after_worker_spawn_hooks(index) ⇒ Object
14 15 16 |
# File 'lib/rspec_queue/configuration.rb', line 14 def self.call_after_worker_spawn_hooks(index) self.instance.after_worker_spawn_block.call(index) if self.instance.after_worker_spawn_block end |
Instance Method Details
#worker_count ⇒ Object
18 19 20 |
# File 'lib/rspec_queue/configuration.rb', line 18 def worker_count @worker_count ||= [env_queue_workers || cpu_count - 1, 1].max end |