This plugin is an Elektra to Ruby bridge and makes is possible to implement Elektra plugins with Ruby. This plugin requires the ruby
binding.
Mount a configuration file using this plugin, which specifying the concrete Ruby Elektra plugin:
3 # call the static function 'define' to define a new Plugin. This
4 # function expects one argument and a block, which implements the plugin
5 Kdb::Plugin.define :somename do
7 # this is automatically defined
8 #@plugin_name = "somename"
11 # 'Open' method, called during Elektra plugin initialization
13 # - errorKey: Kdb::Key, add error information if required
15 # - nil or 0: no error
16 # - -1 : error during initialization
19 # perform plugin initialization
20 # if an error occurs it is save to simply throw an exception. This has the same
21 # semantic as returning -1
24 # the close method is currently not supported, since this will crash the
25 # Ruby-VM if this method should be called during the VM.finalization !!!
31 # 'check_conf' method, called before this plugin is used for mounting to check
32 # if the supplied config is valid. Missing or invalid config settings can be
33 # 'corrected' or added.
35 # - errorKey: Kdb::Key, to add error information
36 # - config: Kdb::KeySet, holds all plugin configuration setting
38 # - nil or 1 : success and the plugin configuration was NOT changed
39 # - 0 : the plugin configuration was changed and is now OK
40 # - -1 : the configuration is NOT OK
41 def check_conf(errorKey, config)
46 # 'get' method, is called during a get cycle, to query all keys
49 # - returned : Kdb::KeySet, already holding keys to be manipulated or to be
50 # filled by a storage plugin. All added keys have to have the same
51 # key name prefix as given by parentKey.
52 # - parentKey: Kdb::Key, defining the current Elektra path. The value of this key
53 # holds the configuration file name to read from
55 # - nil or 1 : on success
56 # - 0 : OK but nothing was to do
58 def get(returned, parentKey)
63 # 'set' method, is called when writing a configuration file
66 # - returned : Kdb::KeySet, holding all keys which should be written to the
68 # - parentKey: Kdb::Key, defining the current Elektra path. The value of this key
69 # holds the configuration file name to write to
71 # - nil or 1 : on success
72 # 0 : on success with no changed keys in database
74 def set(returned, parentKey)
79 # 'error' method, is called when some plugin had a problem during a write cycle
82 # - returned : Kdb::KeySet, holding all keys which should be written to the
84 # - parentKey: Kdb::Key, defining the current Elektra path. The value of this key
85 # holds the configuration file name to write to
87 # - nil or 1 : on success
88 # 0 : on success with no action
90 def error(returned, parentKey)