lib/mutx/tasks/task.rb in mutx-0.1.69 vs lib/mutx/tasks/task.rb in mutx-0.2.0
- old
+ new
@@ -65,11 +65,11 @@
@type = task_data["type"] || "task"
@platform = task_data["platform"] || "command line"
@framework = task_data["framework"]
@command = task_data["command"]
@custom_params = task_data["custom_params"] || []
- @information = task_data["information"]
+ @information = task_data["information"] if (task_data["information"] and task_data["information"] != "")
@running_execs = []
@cucumber = task_data["cucumber"]
@cucumber_report = task_data["cucumber_report"]
@max_execs = task_data["max_execs"] || Mutx::Support::Configuration.maximum_execs_per_task
@cronneable = task_data["cronneable"]
@@ -261,10 +261,16 @@
return "Must define at least one recipient to notify" if recipients.nil?
return "Invalid value for notify on #{notify_on}" if !NOTIFY_VALID_VALUES.include? notify_on
end
end
+ def switch!
+ @task_status = @task_status == "on" ? "off" : "on"
+ self.save!
+ @task_status
+ end
+
def task_data_for task_name
Mutx::Database::MongoConnector.task_data_for(task_name)
end
# Returns the structure of a task data
@@ -319,10 +325,10 @@
def test?
self.type == "test"
end
- def push_exec result_id
+ def push_exec! result_id
@running_execs << result_id
self.save!
end
def delete_exec result_id