|
Revision 6023, 1.3 kB
(checked in by cho45, 17 months ago)
|
|
lang/ruby/misc/lig.rb,
lang/ruby/misc/tig.rb,
lang/ruby/misc/wig.rb:
net-irc/examples に入ったやつを削除
tig.rb は twitter からのリンクをそこにしてしまった関係上そのまま
|
-
Property svn:mime-type set to
text/script
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | #!/usr/bin/env ruby -Ku |
|---|
| 2 | =begin |
|---|
| 3 | |
|---|
| 4 | # tig.rb |
|---|
| 5 | |
|---|
| 6 | Ruby version of TwitterIrcGateway |
|---|
| 7 | ( http://www.misuzilla.org/dist/net/twitterircgateway/ ) |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | ## Install/Run |
|---|
| 11 | |
|---|
| 12 | Now, tig.rb is integrated to net-irc gem. So you can install/run like following: |
|---|
| 13 | |
|---|
| 14 | $ sudo gem install net-irc |
|---|
| 15 | $ cd `ruby -rubygems -e 'print Gem.searcher.find("net/irc").full_gem_path+"/examples"'` |
|---|
| 16 | $ ruby tig.rb # daemonized |
|---|
| 17 | |
|---|
| 18 | You can checkout it from repository. |
|---|
| 19 | |
|---|
| 20 | $ svn co http://svn.coderepos.org/share/lang/ruby/net-irc/trunk/ net-irc |
|---|
| 21 | $ cd net-irc |
|---|
| 22 | $ ruby example/tig.rb |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | ## Client opts |
|---|
| 26 | |
|---|
| 27 | Options specified by after irc realname. |
|---|
| 28 | |
|---|
| 29 | Configuration example of Tiarra ( http://coderepos.org/share/wiki/Tiarra ). |
|---|
| 30 | |
|---|
| 31 | twitter { |
|---|
| 32 | host: localhost |
|---|
| 33 | port: 16668 |
|---|
| 34 | name: username@example.com athack |
|---|
| 35 | password: password on Twitter |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | ### athack |
|---|
| 39 | |
|---|
| 40 | If `athack` client options specified, |
|---|
| 41 | all nick in join message is leading with @. |
|---|
| 42 | |
|---|
| 43 | So if you complemente nicks (ex. irssi), |
|---|
| 44 | it's good for Twitter like reply command (@nick). |
|---|
| 45 | |
|---|
| 46 | In this case, you will see torrent of join messages after connected, |
|---|
| 47 | because NAMES list can't send @ leading nick (it interpreted op.) |
|---|
| 48 | |
|---|
| 49 | =end |
|---|
| 50 | |
|---|
| 51 | require "rubygems" |
|---|
| 52 | require "net/irc" |
|---|
| 53 | require "rbconfig" |
|---|
| 54 | require "pathname" |
|---|
| 55 | |
|---|
| 56 | ruby = Pathname.new(Config::CONFIG["bindir"]) + Config::CONFIG["RUBY_INSTALL_NAME"] |
|---|
| 57 | path = Pathname.new(Gem.searcher.find("net/irc").full_gem_path) + "examples" |
|---|
| 58 | exec(ruby, path + "tig.rb", *ARGV) |
|---|
| 59 | |
|---|