User can select and extend functionality of Svengali through plugin mechanism. Svengali is composed of plugins except for core parts.

By this design..

  • containing dependencies to other compornents such as library or commands on each plugins.
  • make easy to take in codes users of Svengali wrote
  • keep amount of codes users need to deal when he or her expands Svengali low

We are aiming for above.

We adopt this design so that we will develop Svengali with users.


How to use plugin

Plugin can be load by calling load_plugin method.

  1. load_plugin("eucalyptus")

Plugin name to pass is file name of files on plugins directory except for extention part.

Unfortunately, there are no plugins user can uses as of Aug 5th, 2010. However, as we explain how to write original plugin , plase make your original one :-)


How to write plugin

Writing plugin is very simple. You only have to write some Ruby code and place it to plugins directory.

If you want to use a function named "hoge"...

  1. #my_plugin.rb
  2. def hoge()
  3. #codes you want
  4. end

You only have to write code like above and place it on plugins directory. If you want to introduce your original class, steps needed are same with above.

If you want to change or extend original functionalities, you can realize it by replacing function or class definition. You know, such modification can be realized easily in Light weight language such as Ruby

For example, Machine#install_package method is implemented as plugin which extends Machine class,

  1. class Machine
  2. def install_package(package_name_str)
  3. return @ssh.exec!(ExtStr.cmd["package_install"] + " " + package_name_str)
  4. end
  5. end

and Svengali loads it by default.

  1. #svengali/svengali.rb
  2. ----------- ( cutdowned ) -----------
  3. #load default plugins
  4. load_plugin("machine_config")
  5. load_plugin("package")
  6. ----------- ( cutdowned ) -----------


We ask your cooperation

We want to import user wrote plugins to official code. So, please send your plugin to ryo.contact at gmail.com :-)

If you are familiar with github. You can send your code through pull request of github. # repository -> http://github.com/ryogrid/svengali

Names of contributor will go on project official site.

To build Svengali into "good" software, your cooperation is needed.
Thank you very much for your cooperation :-)