Class: Salemove::ProcessHandler::NotifierFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/salemove/process_handler/notifier_factory.rb

Class Method Summary collapse

Class Method Details

.get_notifier(env, process_name, conf) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/salemove/process_handler/notifier_factory.rb', line 9

def self.get_notifier(env, process_name, conf)
  if conf && conf[:type] == 'airbrake'
    Airbrake.configure do |airbrake|
      airbrake.async = true
      airbrake.environment_name = env
      airbrake.secure = true
      airbrake.host = conf.fetch(:host)
      airbrake.api_key = conf.fetch(:api_key)
    end
    Airbrake
  elsif conf && conf[:type] == 'growl'
    GrowlNotifier.new(process_name)
  elsif conf && conf[:type] == 'terminal-notifier'
    TerminalNotifierWrapper.new(process_name)
  end
end