2014-12-22 14:22:04 +03:00
|
|
|
module Devops
|
|
|
|
|
module Loader
|
|
|
|
|
|
2015-01-27 13:18:26 +03:00
|
|
|
class << self
|
2015-06-30 14:27:42 +03:00
|
|
|
def prepare_plugins
|
|
|
|
|
plugins do |plugin|
|
|
|
|
|
plugin.prepare
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def init_plugins
|
2015-02-06 17:21:13 +03:00
|
|
|
plugins do |plugin|
|
|
|
|
|
plugin.init
|
|
|
|
|
end
|
|
|
|
|
end
|
2015-01-27 13:18:26 +03:00
|
|
|
|
2015-02-06 17:21:13 +03:00
|
|
|
def routes
|
|
|
|
|
plugins do |plugin|
|
|
|
|
|
plugin.routes
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def plugins &block
|
2015-01-27 13:18:26 +03:00
|
|
|
if defined?(Devops::Plugin)
|
|
|
|
|
plugins = Devops::Plugin.constants.collect{|s| Devops::Plugin.const_get(s)}.select {|const| const.class == Module}
|
|
|
|
|
puts plugins.inspect
|
|
|
|
|
plugins.each do |p|
|
2015-02-06 17:21:13 +03:00
|
|
|
yield p
|
2015-01-27 13:18:26 +03:00
|
|
|
end
|
2014-12-22 14:22:04 +03:00
|
|
|
end
|
|
|
|
|
end
|
2015-02-06 17:21:13 +03:00
|
|
|
|
2014-12-22 14:22:04 +03:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|