
- Re-factor - Remove code for notifications - Remove addons - Remove travis-core gem. - Ignore logs directory only - Move core tests to spec/lib
25 lines
694 B
Ruby
25 lines
694 B
Ruby
require 'active_support/core_ext/hash/reverse_merge'
|
|
|
|
module Travis
|
|
module Notification
|
|
require 'travis/notification/instrument'
|
|
require 'travis/notification/publisher'
|
|
|
|
class << self
|
|
attr_accessor :publishers
|
|
|
|
def setup(options = { instrumentation: true })
|
|
Travis::Instrumentation.setup if options[:instrumentation] && Travis.config.metrics.reporter
|
|
publishers << Publisher::Log.new
|
|
publishers << Publisher::Redis.new if Travis::Features.feature_active?(:notifications_publisher_redis)
|
|
end
|
|
|
|
def publish(event)
|
|
publishers.each { |publisher| publisher.publish(event) }
|
|
end
|
|
end
|
|
|
|
self.publishers ||= []
|
|
end
|
|
end
|