Class: ParallelTests::Pids
- Inherits:
-
Object
- Object
- ParallelTests::Pids
- Defined in:
- lib/parallel_tests/pids.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#mutex ⇒ Object
readonly
Returns the value of attribute mutex.
Instance Method Summary collapse
- #add(pid) ⇒ Object
- #all ⇒ Object
- #count ⇒ Object
- #delete(pid) ⇒ Object
-
#initialize(file_path) ⇒ Pids
constructor
A new instance of Pids.
Constructor Details
#initialize(file_path) ⇒ Pids
Returns a new instance of Pids.
8 9 10 11 |
# File 'lib/parallel_tests/pids.rb', line 8 def initialize(file_path) @file_path = file_path @mutex = Mutex.new end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
6 7 8 |
# File 'lib/parallel_tests/pids.rb', line 6 def file_path @file_path end |
#mutex ⇒ Object (readonly)
Returns the value of attribute mutex.
6 7 8 |
# File 'lib/parallel_tests/pids.rb', line 6 def mutex @mutex end |
Instance Method Details
#add(pid) ⇒ Object
13 14 15 16 |
# File 'lib/parallel_tests/pids.rb', line 13 def add(pid) pids << pid.to_i save end |
#all ⇒ Object
28 29 30 31 |
# File 'lib/parallel_tests/pids.rb', line 28 def all read pids end |
#count ⇒ Object
23 24 25 26 |
# File 'lib/parallel_tests/pids.rb', line 23 def count read pids.count end |
#delete(pid) ⇒ Object
18 19 20 21 |
# File 'lib/parallel_tests/pids.rb', line 18 def delete(pid) pids.delete(pid.to_i) save end |