2012-12-11 10:42:15 +00:00
|
|
|
module AbfWorker
|
2012-12-11 15:25:25 +00:00
|
|
|
class BaseObserver
|
2012-12-11 10:42:15 +00:00
|
|
|
BUILD_COMPLETED = 0
|
|
|
|
BUILD_FAILED = 1
|
|
|
|
BUILD_PENDING = 2
|
|
|
|
BUILD_STARTED = 3
|
|
|
|
BUILD_CANCELED = 4
|
2012-12-11 11:47:32 +00:00
|
|
|
|
2012-12-11 15:25:25 +00:00
|
|
|
def self.update_results(subject, options)
|
2012-12-11 11:47:32 +00:00
|
|
|
results = (subject.results || [])+ options['results']
|
|
|
|
subject.results = results.sort_by{ |r| r['file_name'] }
|
|
|
|
subject.save!
|
|
|
|
end
|
|
|
|
|
2012-12-11 10:42:15 +00:00
|
|
|
end
|
|
|
|
end
|