Class: Hobix::BasePlugin
- Inherits:
-
Object
- Object
- Hobix::BasePlugin
- Defined in:
- lib/hobix/base.rb
Overview
from it.
Direct Known Subclasses
AkismetKey, BaseFacet, BaseOutput, BasePublish, BaseStorage, BixWikPlugin, BloglinesPlugin, FlickrPlugin, RecentCommentsPlugin, SidebarCalendarPlugin
Constant Summary collapse
- @@plugins =
{}
- @@required_from =
nil
Class Method Summary collapse
- .inherited(sub) ⇒ Object
-
.start(req, opts, weblog) ⇒ Object
Initializes all the plugins, returning an Array of plugin objects.
Class Method Details
.inherited(sub) ⇒ Object
56 57 58 59 |
# File 'lib/hobix/base.rb', line 56 def BasePlugin.inherited( sub ) @@plugins[@@required_from] ||= [] @@plugins[@@required_from] << sub end |
.start(req, opts, weblog) ⇒ Object
Initializes all the plugins, returning an Array of plugin objects. (Used by the Hobix::Weblog
class.)
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/hobix/base.rb', line 36 def BasePlugin.start( req, opts, weblog ) @@required_from = req = req.dup if req.tainted? req.untaint if req =~ /^[\w\/\\]+$/ end require( req ) @@required_from = nil if @@plugins[req] @@plugins[req].collect do |p| if opts p.new( weblog, opts ) else p.new( weblog ) end end else [] end end |