Class: Sbuilder::SnippetLoaderPlugin

Inherits:
LoaderPluginRoot show all
Includes:
SnippetLoaderPluginMixer
Defined in:
lib/sbuilder/facade/snippet_loader_plugin.rb

Direct Known Subclasses

SnippetLoaderSimple

Constant Summary

Constants inherited from LoaderPluginRoot

LoaderPluginRoot::PROGNAME

Constants included from Utils::MyLogger

Utils::MyLogger::LOGFILE

Constructor and Object Initialize collapse

Configure Plugin collapse

Register snippets to sbuilder collapse

Methods included from SnippetLoaderPluginMixer

#registerMetatype, #registerSnippets, #setSnippetFacade, #snippetFacade, validateProperties

Methods inherited from LoaderPluginRoot

#configure, #doConfigure, #logger, #oneOf, validateProperties, #validateProperties

Methods included from Utils::MyLogger

#getLogger, #logfile

Constructor Details

#initialize(options = {}) ⇒ SnippetLoaderPlugin




24
25
26
# File 'lib/sbuilder/facade/snippet_loader_plugin.rb', line 24

def initialize( options = {} )
  super( options )
end

Class Method Details

.configure(configuration) ⇒ Object

Configure API loader - MUST be implemented by plugin class

Parameters:

  • configuration (Hash)

    properties to configure



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/sbuilder/facade/snippet_loader_plugin.rb', line 36

def self.configure( configuration )
  raise PluginException.new <<-EOS unless configuration.nil?
  Plugin classes should implement class method #{__method__}


  This error is raised when using 'configuration' -property in 'extend.loaders' array entry.
  For example:

  extend:
      loaders:
        - className: Sbuilder::XXXX::Plugin
          gem: sbuilder-xxxx
          configuration: any value

  and the plugin class (e.g. Sbuilder::XXXX::Plugin) does not implement class 
  method '.#{__method__}'

  EOS
end

Instance Method Details

#doRegisterSnippets(snippetsDefs) ⇒ Object

Abstract method, which must be implemented by concrete snippet loader plugin

This method should use ‘handOver’ method, which passes snippet, along with metadata, via snippet loader snippetFacade to sbuilder.



67
68
69
# File 'lib/sbuilder/facade/snippet_loader_plugin.rb', line 67

def doRegisterSnippets( snippetsDefs )
  raise PluginException.new "Missing implementation for  'doRegisterSnippets'"
end