Skip to content

Commit

Permalink
Extend the Vmdb::Plugins singleton with UI-specific plugin support
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Jun 6, 2017
1 parent d07a5ef commit a7e2ecc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/vmdb/plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ class Plugins
include Singleton

attr_reader :registered_automate_domains
attr_reader :registered_ui_plugins

def initialize
@registered_automate_domains = []
@registered_provider_plugin_map = {}
@registered_ui_plugins = []
@vmdb_plugins = []
end

Expand All @@ -28,6 +30,7 @@ def register_vmdb_plugin(engine)

register_automate_domains(engine)
register_provider_plugin(engine)
register_ui_plugin(engine)

# make sure STI models are recognized
DescendantLoader.instance.descendants_paths << engine.root.join('app')
Expand Down Expand Up @@ -59,5 +62,9 @@ def register_automate_domains(engine)
@registered_automate_domains << AutomateDomain.new(domain_directory)
end
end

def register_ui_plugin(engine)
@registered_ui_plugins << engine if engine.try(:ui_plugin)
end
end
end

0 comments on commit a7e2ecc

Please sign in to comment.