travis-api/lib/travis/services/update_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

32 lines
821 B
Ruby

require 'travis/support/instrumentation'
require 'travis/services/base'
module Travis
module Services
class UpdateLog < Base
extend Travis::Instrumentation
register :update_log
def run
log = run_service(:find_log, id: params[:id])
log.update_attributes(archived_at: params[:archived_at], archive_verified: params[:archive_verified]) if log
end
instrument :run
class Instrument < Notification::Instrument
def run_completed
publish(
msg: "for #<Log id=#{target.params[:id]}> params=#{target.params.inspect}",
object_type: 'Log',
object_id: target.params[:id],
params: target.params,
result: result
)
end
end
Instrument.attach_to(self)
end
end
end