fluke/devops-service/loader.rb
2015-02-06 17:21:13 +03:00

30 lines
559 B
Ruby

module Devops
module Loader
class << self
def init_plugins
plugins do |plugin|
plugin.init
end
end
def routes
plugins do |plugin|
plugin.routes
end
end
def plugins &block
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|
yield p
end
end
end
end
end
end