class Fuey::Client
Public Class Methods
new(path_to_config_dir="", notifications=nil)
click to toggle source
# File lib/fuey_client/fuey/client.rb, line 13 def initialize(path_to_config_dir="", notifications=nil) Configurethis.root_path = path_to_config_dir notifications = Config::Fuey.notifications if notifications.nil? setup_notifications notifications end
Public Instance Methods
reporter()
click to toggle source
# File lib/fuey_client/fuey/client.rb, line 20 def reporter @_reporter ||= Reporters::NotificationQueue.new(Fuey::Redis.instance) end
run()
click to toggle source
# File lib/fuey_client/fuey/client.rb, line 24 def run TraceRepository.new.all.each do |trace| trace.receiver = reporter output = trace.run Log.write %([#{trace.name}] #{output}) end end
setup_notifications(notifications)
click to toggle source
# File lib/fuey_client/fuey/client.rb, line 32 def setup_notifications(notifications) notifications.each do |name, subscriber| ActiveSupport::Notifications.subscribe name, ActiveSupport::Inflector.constantize(subscriber).new end end