Cereal

This package contains Cereal, an event-driven IRC framework built on EventMachine and inspired by Paul Mutton’s excellent PircBot IRC framework for Java.

Cereal has the following features:

  • Easy to use! Cereal is designed for quick-and-easy implementation, just like PircBot. Your first bot can be set up by overriding a single class.

  • Your specific functionality is easily added by overriding logically-named methods, like on_message.

Be sure not to confuse Cereal and CerealBot. Cereal is a standalone IRC framework. By itself, Cereal does nothing. CerealBot, on the other hand, is a fully-featured IRC bot project by the same people who have ruined your life with Cereal.

Authors

Ross “Raws” Paffett

Lead developer.

Brian “TecnoBrat” S.

Inspiration, Ruby knowledge, general abuse.

Jon “Corgan” R.

Butts.

Download

Cereal is currently hosted at cerealbot.org.

Installation

Gem Installation from Source

Generate a Cereal .gem file and install it with the following commands:

rake package
gem install --local pkg/cereal

Cereal will now be available to your Ruby code through rubygems:

require 'rubygems'
require 'cereal'

You can clean up the package rake task files with:

rake clobber_package

Generate Documentation

You may generate documentation from source with the following command:

rake rdoc

RDoc documentation will be created in the directory “doc”.

You can clean up the rdoc rake task files with:

rake clobber_rdoc

Simple Example

Once installed, you can create your first bot!

require 'rubygems'
require 'cereal'

class MyBot < Cereal::Bot
  def initialize
    super
    @name = 'My Bot'
    @nick = 'MyBot'
    @verbose = true
  end

  def on_connect(host)
    puts "Connected to #{host}!"

    join('#cerealbot')

    msg('#cerealbot', 'Hi!')
    msg('Corgan', 'Hello!')
  end
end

bot = MyBot.new
bot.connect('irc.freenode.net')

Documentation

See the RDoc documentation for the Cereal module for more information.

License

Cereal is available under the MIT license. See the file MIT-LICENSE.