Module: Sensu::Extensions
- Defined in:
- lib/sensu/extensions.rb,
lib/sensu/extensions/loader.rb
Defined Under Namespace
Classes: Loader
Class Method Summary collapse
-
.get(options = {}) ⇒ Loader
Retrieve the current loaded extensions loader or load one up if there isn’t one.
-
.load(options = {}) ⇒ Loader
Load Sensu extensions.
Class Method Details
.get(options = {}) ⇒ Loader
Retrieve the current loaded extensions loader or load one up if there isn’t one. Note: We may need to add a mutex for thread safety.
36 37 38 |
# File 'lib/sensu/extensions.rb', line 36 def get(={}) @loader || load() end |
.load(options = {}) ⇒ Loader
Load Sensu extensions.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sensu/extensions.rb', line 13 def load(={}) @loader = Loader.new if [:extension_file] @loader.load_file([:extension_file]) end if [:extension_dir] @loader.load_directory([:extension_dir]) end if [:extension_dirs] [:extension_dirs].each do |directory| @loader.load_directory(directory) end end @loader.load_instances @loader end |