Navigation Menu

Skip to content

Commit

Permalink
Update plugin definition example for the latest (paper) spec
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Feb 7, 2014
1 parent 5adc23c commit ab1b050
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tutorial/plugin-development/adapter/index.md
Expand Up @@ -48,20 +48,26 @@ engine

### Create a plugin

Put a plugin code into `input_adapter` directory.
Put a plugin code into a file `store_search.rb` in the `plugin` directory.

lib/droonga/plugin/input_adapter/example.rb:
lib/droonga/plugin/store_search.rb:

~~~ruby
module Droonga
class ExampleInputAdapterPlugin < Droonga::InputAdapterPlugin
repository.register("example", self)
module StoreSearchPlugin
Plugin.repository.register("store-search", self)

class Adapter < Droonga::Adapter
# You'll put codes to modify messages here.
end
end
~~~

This plugin does nothing except registering itself to Droonga.

* The `store-search` is the name of the plugin itself. You'll use it in your `catalog.json`, to activate the plugin.
* As the example above, you must define your plugin as a module.


### Activate plugin with `catalog.json`

You need to update `catalog.json` to activate your plugin.
Expand Down

0 comments on commit ab1b050

Please sign in to comment.