lib/flapjack/configuration.rb in flapjack-0.6.45 vs lib/flapjack/configuration.rb in flapjack-0.6.46
- old
+ new
@@ -1,20 +1,10 @@
#!/usr/bin/env ruby
require 'yaml'
require 'logger'
-require 'flapjack/executive'
-
-require 'flapjack/gateways/api'
-require 'flapjack/gateways/jabber'
-require 'flapjack/gateways/oobetet'
-require 'flapjack/gateways/pagerduty'
-require 'flapjack/gateways/email'
-require 'flapjack/gateways/sms'
-require 'flapjack/gateways/web'
-
module Flapjack
class Configuration
def initialize(opts = {})
@@ -58,40 +48,9 @@
{ :host => (redis['host'] || '127.0.0.1'),
:port => (redis['port'] || 6379)})
)
redis_config
- end
-
- PIKELET_TYPES = {'executive' => Flapjack::Executive}
-
- GATEWAY_TYPES = {'web' => Flapjack::Gateways::Web,
- 'api' => Flapjack::Gateways::API,
- 'jabber' => Flapjack::Gateways::Jabber,
- 'pagerduty' => Flapjack::Gateways::Pagerduty,
- 'oobetet' => Flapjack::Gateways::Oobetet,
- 'email' => Flapjack::Gateways::Email,
- 'sms' => Flapjack::Gateways::Sms}
-
- def pikelets
- return {} unless @config_env
- @config_env.inject({}) {|memo, (k, v)|
- if klass = PIKELET_TYPES[k]
- memo[klass] = v
- end
- memo
- }
- end
-
- def gateways
- return {} unless @config_env && @config_env['gateways'] &&
- !@config_env['gateways'].nil?
- @config_env['gateways'].inject({}) {|memo, (k, v)|
- if klass = GATEWAY_TYPES[k]
- memo[klass] = v
- end
- memo
- }
end
def load(filename)
unless File.file?(filename)
logger.error "Could not find file '#{filename}'"