# PluginFactory 1.0.6

**URL:** <https://www.ruby-forum.com/t/pluginfactory-1-0-6/185637>\
**Category:** Ruby\
**Created:** [March 23, 2010, 10:06pm UTC](https://www.ruby-forum.com/t/pluginfactory-1-0-6/185637 "2010-03-23T22:06:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [March 23, 2010, 10:06pm UTC](https://www.ruby-forum.com/t/pluginfactory-1-0-6/185637/1 "2010-03-23T22:06:31Z")

</div>

Version 1.0.6 of pluginfactory has been released.

PluginFactory is a mixin for adding plugin classes to your application.  
It adds a ‘create’ method to your base plugin class that can be used to  
search for/and load them later.

For example, if you want pluggable ‘driver’ classes for your library,  
you can define the base class like so:

require ‘pluginfactory’

class Driver  
include PluginFactory

```
# Set one or more paths to use when searching for
# 'Driver' plugins
def self::derivative_dirs
   ["drivers"]
end

```

end

Now, if someone wants to provide their own plugin, they just inherit  
from ‘Driver’ like so:

require ‘driver’  
class SpecialDriver \< Driver  
# …do special driver-ish things  
end

saves it as `drivers/special.rb’ (or one of several other variants) in  
their library, and then load it by name via the superclass:

special = Driver.create( ‘special’ )

PluginFactory will search for the correct require, require your library,  
and create a new instance of the appropriate subclass. Any additional  
arguments to ‘create’ will be passed to the subclass’s constructor.

== Project Page

[dev(E)iate](http://deveiate.org/projects/PluginFactory/)

== Installation

Via gems:

$ sudo gem install pluginfactory

or from source:

$ wget [http://deveiate.org/code/pluginfactory-1.0.6.tar.gz](http://deveiate.org/code/pluginfactory-1.0.6.tar.gz)  
$ tar -xzvf pluginfactory-1.0.6.tar.gz  
$ cd pluginfactory-1.0.6  
$ sudo rake install

== Changes

Repackaging for newer Rubygems. This release contains no major code  
changes.
