travis-api/lib/travis/services/find_log.rb
Aakriti Gupta 65f1a29d86 Move travis-core files from /vendor to /lib.
- Re-factor
- Remove code for notifications
- Remove addons
- Remove travis-core gem.
- Ignore logs directory only
- Move core tests to spec/lib
2016-07-20 11:22:25 +02:00

34 lines
668 B
Ruby

require 'travis/services/base'
module Travis
module Services
class FindLog < Base
register :find_log
def run(options = {})
result if result
end
def final?
# TODO jobs can be requeued, so finished jobs are no more final
# result && result.job && result.job.finished?
false
end
# def updated_at
# result.updated_at
# end
private
def result
@result ||= if params[:id]
scope(:log).find_by_id(params[:id])
elsif params[:job_id]
scope(:log).where(job_id: params[:job_id]).first
end
end
end
end
end