This plugin is an Elektra to Ruby bridge and makes is possible to implement Elektra plugins with Ruby. This plugin requires the swig_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 # generally it is save to simply throw an exception. This has the same
20 # semantic as returning -1
23 # the close method is currently not supported, since this will crash the
24 # Ruby-VM if this method should be called during the VM.finalization !!!
30 # 'check_conf' method, called before this plugin is used for mounting to check
31 # if the supplied config is valid. Missing or invalid config settings can be
32 # 'corrected' or added.
34 # - errorKey: Kdb::Key, to add error information
35 # - config: Kdb::KeySet, holds all plugin configuration setting
37 # - nil or 1 : success and the plugin configuration was NOT changed
38 # - 0 : the plugin configuration was changed and is now OK
39 # - -1 : the configuration is NOT OK
40 def check_conf(errorKey, config)
45 # 'get' method, is called during a get cycle, to query all keys
48 # - returned : Kdb::KeySet, already holding keys to be manipulated or to be
49 # filled by a storage plugin. All added keys have to have the same
50 # key name prefix as given by parentKey.
51 # - parentKey: Kdb::Key, defining the current Elektra path. The value of this key
52 # holds the configuration file name to read from
54 # - nil or 1 : on success
55 # - 0 : OK but nothing was to do
57 def get(returned, parentKey)
62 # 'set' method, is called when writing a configuration file
65 # - returned : Kdb::KeySet, holding all keys which should be written to the
67 # - parentKey: Kdb::Key, defining the current Elektra path. The value of this key
68 # holds the configuration file name to write to
70 # - nil or 1 : on success
71 # 0 : on success with no changed keys in database
73 def set(returned, parentKey)
78 # 'error' method, is called when some plugin had a problem during a write cycle
81 # - returned : Kdb::KeySet, holding all keys which should be written to the
83 # - parentKey: Kdb::Key, defining the current Elektra path. The value of this key
84 # holds the configuration file name to write to
86 # - nil or 1 : on success
87 # 0 : on success with no action
89 def set(returned, parentKey)