An IRC wrapper around TCPSocket
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.gitignore
LICENSE
README.rdoc
irc-socket.gemspec

README.rdoc

Description

IRCSocket is an IRC wrapper around a TCPSocket. It implements all of the major commands laid out in RFC 2812. All these commands are available as instance methods of an IRCSocket Object.

API documentation is available here

Example

irc = IRCSocket.new('irc.freenode.org')
irc.connect

if irc.connected?
  irc.nick "HulkHogan"
  irc.user "Hulk", 0, "*", "I am Hulk Hogan"

  while line = irc.read

    # Join a channel after MOTD
    if line.split[1] == '376'
      irc.join "#mychannel"
    end

    puts "Received: #{line}"
  end
end

Installation

gem install irc-socket

Or alternatively you can clone the Github repository

git clone https://github.com/injekt/irc-socket

Notes

I may have missed something in the RFC. Patches welcome.