Module: Mutx::Results

Defined in:
lib/mutx/results/result.rb,
lib/mutx/results/results.rb

Defined Under Namespace

Classes: Result

Class Method Summary collapse

Class Method Details

.all_resultsObject



39
40
41
# File 'lib/mutx/results/results.rb', line 39

def self.all_results
  Mutx::Database::MongoConnector.all_results
end

.all_results_for(task_id) ⇒ Object



5
6
7
# File 'lib/mutx/results/results.rb', line 5

def self.all_results_for task_id
  Mutx::Database::MongoConnector.results_for task_id
end

.all_results_idsObject



19
20
21
# File 'lib/mutx/results/results.rb', line 19

def self.all_results_ids
  Mutx::Database::MongoConnector.all_results_ids
end

.find_all_for_key(key) ⇒ Object



43
44
45
# File 'lib/mutx/results/results.rb', line 43

def self.find_all_for_key key
  Mutx::Database::MongoConnector.find_results_for_key key
end

.find_for(key) ⇒ Object



23
24
25
# File 'lib/mutx/results/results.rb', line 23

def self.find_for key
  Mutx::Database::MongoConnector.find_results_for_key key
end

.find_for_status(status) ⇒ Object



31
32
33
# File 'lib/mutx/results/results.rb', line 31

def self.find_for_status status
  Mutx::Database::MongoConnector.find_results_for_status status
end

.find_for_task(task_name) ⇒ Object



35
36
37
# File 'lib/mutx/results/results.rb', line 35

def self.find_for_task task_name
  Mutx::Database::MongoConnector.find_results_for_task task_name
end

.reset!Object

Resets all results with running status



48
49
50
51
52
53
54
# File 'lib/mutx/results/results.rb', line 48

def self.reset!
  Mutx::Database::MongoConnector.running_results.each do |result|
    Mutx::Support::Processes.kill_p(result["pid"]) if result["pid"]
    res = Mutx::Results::Result.get(result["_id"])
    res.reset!
  end
end

.results_ids_for(task_id) ⇒ Object



9
10
11
12
13
# File 'lib/mutx/results/results.rb', line 9

def self.results_ids_for task_id
  all_results_for(task_id).map do |result|
    result["_id"]
  end
end

.running_results_for_task_id(task_id) ⇒ Object



15
16
17
# File 'lib/mutx/results/results.rb', line 15

def self.running_results_for_task_id task_id
  Mutx::Database::MongoConnector.running_results_for_task_id task_id
end

.status_for(result_id) ⇒ Object



27
28
29
# File 'lib/mutx/results/results.rb', line 27

def self.status_for result_id
  Mutx::Database::MongoConnector.status_for_result result_id
end