plagger's like plugin system for classx based application.
walf443/classx-pluggable
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
= classx-pluggable plagger's like plugin system for classx based applicaton == Synopsis in your context class. require 'classx' require 'classx/pluggable' class YourApp include ClassX include ClassX::Pluggable def run call_event("SETUP", {}) # you app call_event("TEARDOWN", {}) end end in your plugin class require 'classx' require 'classx/pluggable' class YourApp class Plugin include ClassX include ClassX::Pluggable::Plugin class SomePlugin < Plugin def register add_event("SETUP", :on_setup) end def on_setup param # param is Hash # hooked setup end end end end or it's easy to defining with ClassX::Pluggable::Plugin::AutoRegister class YourApp class Plugin include ClassX include ClassX::Pluggable::Plugin include ClassX::Pluggable::Plugin::AutoRegister class SomePlugin < Plugin def on_setup param # do some thing. end end end end and, on your start up script. app = YourApp.new app.load_plugins([ { :module => YourApp::Plugin::SomePlugin, :config => {} }, ]) app.run == Description == Installation === Archive Installation rake install === Gem Installation gem install classx-pluggable == Features/Problems CAVEAT: this project is early development. API may be vary in future. == Copyright Author:: Keiji, Yoshimi <walf443 at gmail.com> Copyright:: Copyright (c) 2008 Keiji, Yoshimi License:: you can redistribute it and/or modify it under the same terms as Ruby itself.
About
plagger's like plugin system for classx based application.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published