#!/usr/bin/env ruby -Ku
=begin

# tig.rb

Ruby version of TwitterIrcGateway
( http://www.misuzilla.org/dist/net/twitterircgateway/ )


## Install/Run

Now, tig.rb is integrated to net-irc gem. So you can install/run like following:

	$ sudo gem install net-irc
	$ cd `ruby -rubygems -e 'print Gem.searcher.find("net/irc").full_gem_path+"/examples"'`
	$ ruby tig.rb # daemonized

You can checkout it from repository.

	$ svn co http://svn.coderepos.org/share/lang/ruby/net-irc/trunk/ net-irc
	$ cd net-irc
	$ ruby example/tig.rb


## Client opts

Options specified by after irc realname.

Configuration example of Tiarra ( http://coderepos.org/share/wiki/Tiarra ).

	twitter {
		host: localhost
		port: 16668
		name: username@example.com athack
		password: password on Twitter
	}

### athack

If `athack` client options specified,
all nick in join message is leading with @.

So if you complemente nicks (ex. irssi),
it's good for Twitter like reply command (@nick).

In this case, you will see torrent of join messages after connected,
because NAMES list can't send @ leading nick (it interpreted op.)

=end

require "rubygems"
require "net/irc"
require "rbconfig"
require "pathname"

ruby = Pathname.new(Config::CONFIG["bindir"]) + Config::CONFIG["RUBY_INSTALL_NAME"]
path = Pathname.new(Gem.searcher.find("net/irc").full_gem_path) + "examples"
exec(ruby, path + "tig.rb", *ARGV)


