Friday, 2 May 2008

Rorbby #rubyonrails api bot



An irc bot written in ruby to fuzzy search every method in the combined ruby and rails docs, returning definition, example and tinyurl (and currently working pretty well under ruby 1.9 without a database).

basic usage:

?api_method:args:args:args [nick]
??faq_keyword [nick]

You can also query rorbby via private message (although faq topics can only be defined in open channel)

Populating the faq

if the phrase begins with the keyword:

03:05 <@brough> rorbby, select is broken.
03:05 <@brough> ??select
03:05 <@rorbby> select is broken.

alternatively, define the keyword first:

03:11 <@brough> rorbby, scaling: Rails can instantaneously project solid matter to any point on the internet, in any shape or color you might imagine. For *any* purpose! Creation by mere thought. (Question about the 8,000 cubic miles of klystron relays? See: scaling_performance)
03:11 <@brough> ??scaling
03:11 <@rorbby> Rails can instantaneously project solid matter to any point on the internet, in any shape or color you might imagine. For *any* purpose! Creation by mere thought. (Question about the 8,000 cubic miles of klystron relays? See: scaling_performance)


to overwrite an existing definition, append a splat:


03:12 <@brough> rorbby, select is fixed. *
03:12 <@brough> ??select
03:12 <@rorrby> select is fixed.

FAQ definitions can be created as an array:

05:17 <> ??vps
05:18 <> rorbby, vps: <<> rorbby, vps: <<> ??vps
05:18 <> slicehost.com, bytemark.co.uk, linode.com

You can remove items from the list with '>>'

API definitions (for Rails api queries just omit the first ':ruby' param)

for example, targeting the following methods in the ruby api:


alive? (Thread)
alive? (DRb::DRbTCPSocket)
alive? (DRb::ExtServ)
alive? (Rinda::TupleEntry)
alive? (DRb::DRbServer)


return all methods that contain the query string:

02:59 <@brough> ?ali:ruby:fuzzy
02:59 <@rorbby> add_alias RUBY:RDoc; add_alias RUBY:RDoc; add_finalizer RUBY; alias_command
RUBY:She; alias_command RUBY; alias_extension RUBY:RDoc; alias_map RUBY:She;
alias_method RUBY; aliases RUBY:Gen; alive? RUBY (10 of 105)

return the first method name exactly matching the query string:

02:58 <@brough> ?alive?:ruby
02:59 <@rorbby> alive? (DRb::DRbServer) Is this server alive? ...

drill it down:

03:01 <@brough> ?alive?:ruby:th
03:01 <@rorbby> alive? (RUBY::Thread) Returns true if thr is running or sleeping. ... thr =
Thread.new { }; thr.join #=> #...


03:01 <@brough> ?alive?:ruby:drb
03:01 <@rorbby> alive? (DRb::DRbServer) Is this server alive? ...

03:02 <@brough> ?alive?:ruby:drb:tcp
03:02 <@rorbby> alive? (DRb::DRbTCPSocket) Check to see if this connection is alive. ...

private queries contain fuller descriptions and more usage examples:

02:55 <@brough> ?>>:ruby:proc brough
02:55 <@rorbby> >> (Process::Status) Shift the bits in stat right num places. fork { exit 99 } #=>
26563; Process.wait #=> 26563; $?.to_i #=> 25344; $? >> 8 #=> 99

http://github.com/broughcut/rorapi

36 comments:

黑色 said...

成人色情小?成人色情影片成人色情影片0951成人色情影片線上觀賞下載成人色情影片播放下載成人色情免費小遊戲成人色情免費網站成人色情免費網成人色情a片成人色情片成人色情狂影片成人色情由細區成人色情站成人色情網成人色情遊戲成人色情電話成人色情電影成人色情露點貼圖成人色情論壇成人色情貼圖成人色情貼圖片成人色情貼圖綱成人色情貼圖網站成人色情貼圖dvd成人色情影集成人色情故事成人色情文學打手槍色情短片找線上色情直播影片找色情聊天室摸摸耳18禁色情遊戲摸摸耳色情摸摸耳色情遊戲撥打色情電話播放色情電影日本av女優色情貼圖網日本av女優色情圖片日本av女優色情影片日本美女色情片日本色情

西雅圖 said...

18禁貼圖寫真視訊援交露點爆乳潮吹裸體裸照裸女愛愛無碼尋夢視訊聊天a漫a片a圖一夜情一葉情人妻激情情色寫真美女自拍辣妹自拍正妹自拍美女走光辣妹走光正妹走光脫衣秀脫衣走光色情自慰自拍

ya said...

Joy shared with others are more enjoyed...................................................

于名于倫 said...

好的部落格就要和好朋友分享--感謝分享.........................

有南 said...

與其爭取不可能得到的東西,不如善自珍惜運用自己所擁有的........................................

SydneyJ22985 said...

nice to know you ~........................................

裕以 said...

情色巨乳人妻a圖18禁成人自拍裸體成人聊天室走光色情影片av色情做愛sex成人影片18成人性愛線上a片自慰情趣嘿咻情色網網愛聊天情色影片愛愛色情網站性愛影片性愛圖作愛一夜情做愛自拍口交性交露點裸照成人圖片sexy潮吹台灣情色網a圖a圖

RexTemples20144 said...

非常感謝~3Q~....................................................

妍慧 said...

great msg for me, thanks a lot dude˙﹏˙

韋于倫成 said...

生存乃是不斷地在內心與靈魂交戰;寫作是坐著審判自己。 ..................................................

健豪 said...

Custom makes all things easy~~加油哦 ....................................................

哲宇皓云 said...

喘口氣,看個文章,謝謝您的格子囉~~..................................................

佩GailBohanan1蓉 said...

It takes all kinds to make a world.............................................................

SadeRa盈君iford0412 said...

happy to read~ thank you!..................................................

冠慧 said...

It is easier to get than to keep it...................................................................

林奕廷 said...

very nice blog~~......................................................................

江婷 said...

一個人的價值,應該看他貢獻了什麼,而不是他取得了什麼.................................................................

韋以韋以 said...

要保持更新呦,加油!!!期待你的新文章!!!.................................................................                           

志穎志穎 said...

知識可以傳授,智慧卻不行。每個人必須成為他自己。....................................................................

婷珊 said...

Quietude is the crown of life.............................................................

志穎志穎 said...

喜歡看大家的文章,每篇都是一個故事,都是一種心情~~祝大家開心愉快............................................................

rreynolds385 said...

來幫你衝一下人氣,幫你推推推..................................................................

承蘋承蘋 said...

才華在逆境中展現,在順境中被掩藏。..................................................................

曹依潔曹依潔 said...

河水永遠是相同的,可是每一剎那又都是新的。..................................................

宥妃宥妃 said...

一個人的快樂,不是因為他擁有的多,而是他計較的少。..................................................

芳綠 said...

讚啦~~多謝分享!!>ˍ<............................................................

錢靜怡錢靜怡錢靜怡 said...

耐心是一株很苦的植物,但果實卻很甜美。..................................................

DaniloM_W志竹olff0615 said...

不妄求,則心安;不妄作,則身安!......................................................

淑李娟 said...

No pains, no gains..................................................................

張陳俊凱柏 said...

Knowledge is a treasure, but practice is the key to it.................................................

惠宛佳桂 said...

人生就像一顆核桃,必須敲破它,才會顯出他的內容。......................................................

佳陳容 said...

你要保守你的心,勝過保守一切,因為一生的果效是由心發出................................................

红意 said...

I love readding, and thanks for your artical.............................................................

怡屏 said...

人不能像動物一樣活著,而應該追求知識和美德............................................................

廷家祥家祥雯 said...

人應該做自己認為對的事,而不是一味跟著群眾的建議走。..................................................

翊翊翊翊張瑜翊翊翊 said...

與朋友在一起,分擔的痛苦是減半的痛苦,分享的快樂是加倍的快樂。......................................................................