Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taiki45/mikutter-plugin-base
Deprecated
https://github.com/taiki45/mikutter-plugin-base
Last synced: 13 days ago
JSON representation
Deprecated
- Host: GitHub
- URL: https://github.com/taiki45/mikutter-plugin-base
- Owner: taiki45
- License: mit
- Created: 2013-02-17T08:51:13.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-24T14:49:00.000Z (over 11 years ago)
- Last Synced: 2024-03-14T21:23:48.507Z (8 months ago)
- Language: Ruby
- Homepage:
- Size: 156 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# MikutterPluginBase
Add new way to write mikutter plugin.
## Installation
Add this line to your mikutter's Gemfile:
gem 'mikutter_plugin_base'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mikutter_plugin_base
Finally execute mikkuter with bundled gems:
$ bundle exec ruby mikkuter.rb
## Usage
```ruby
# path/to/mikutter/plugin/dir/sample.rb
require 'mikutter_plugin_base'class Sample < Mikutter::PluginBase
def run(plugin)
"write your code here."
"you can access mikutter plugin api via `plugin`."
enddef on_update(service, messages)
"define mikutter event callbacks, hooks, filters as method."
"plugin base will automatically add them."
end
end# at last of your plugin script do `resister!`
Sample.register!
```## Detail
This gem just convert your plugin code.Plugin like this code goes...
```ruby
class SamplePlugin < Mikutter::PluginBase
def run(plugin)
@data_store = setup
enddef on_update(service, messages)
messages.each do |msg|
@data_store.save msg
end
end
endSamplePlugin.register!
```like this.
```ruby
Plugin.create :sample_plugin do |plugin|
@data_store = setupon_update do |service, messages|
messages.each do |msg|
@data_store.save msg
end
end
end
```## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request