Forum: Ruby IRC like interface

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B4bbf6ff77b95b02451fbd6aa39eff4a?d=identicon&s=25 Juergen Fiedler (juergen)
on 2006-01-04 17:44
Hi,

I would like to try to write a text based Jabber client in Ruby, but
being that I am rather new to it, I am running into problems already:
I would like a text based user interface that looks somewhat like the
classic IRC clients: An input line at the bottom of the screen with the
rest of the screen being available for asyncronous output.
If at all possible, I would also like to support the readline library
for text input.
I figured I would use curses to keep input and output separated,
maintaining a separate cursor position for text that is typed in and for
text that comes in over a socket, for example. I have no idea, though,
how to get readline into the equation - and even without that, I am not
sure whether my approach would be really ideal.
Is there any easy to understand example code out there that would
illustrate how to program a simple chat client with a text based user
interface?

Any input would be much appreciated.
Thanks,
 -juergen
Fd22ee3cfc7dac283ce8e451af324f7d?d=identicon&s=25 Chad Perrin (Guest)
on 2006-01-04 22:25
(Received via mailing list)
On Thu, Jan 05, 2006 at 01:44:24AM +0900, Juergen Fiedler wrote:
> I figured I would use curses to keep input and output separated,
> maintaining a separate cursor position for text that is typed in and for
> text that comes in over a socket, for example. I have no idea, though,
> how to get readline into the equation - and even without that, I am not
> sure whether my approach would be really ideal.
> Is there any easy to understand example code out there that would
> illustrate how to program a simple chat client with a text based user
> interface?

I don't know of Ruby projects of that sort, off the top of my head, but
there's an open source multiprotocol IM client called centericq that
might at least give you some vague ideas.  Without double-checking, I
seem to recall that it was written in Perl, though for all I know right
now it could be C.  I know it uses ncurses, at least.

--
Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]

"A script is what you give the actors.  A program
is what you give the audience." - Larry Wall
B4bbf6ff77b95b02451fbd6aa39eff4a?d=identicon&s=25 Juergen Fiedler (juergen)
on 2006-01-04 22:38
Chad Perrin wrote:
[...]
> I don't know of Ruby projects of that sort, off the top of my head, but
> there's an open source multiprotocol IM client called centericq that
> might at least give you some vague ideas.  Without double-checking, I
> seem to recall that it was written in Perl, though for all I know right
> now it could be C.  I know it uses ncurses, at least.

Centericq is what I use when I don't play with new Jabber clients. It is
in fact C these days and an 'ldd /usr/bin/centericq' gives me a very
long list ending with

> libkitchensink.so.11 => /usr/lib/libkitchensink.so.11 (0xb782a000)

yet it does not appear to use libreadline.

One program that uses both is freetalk, a pure Jabber client - but I
find the  C source (which relies heavily on callbacks) rather hard to
follow.

Thanks for the input,
 --j
Fd22ee3cfc7dac283ce8e451af324f7d?d=identicon&s=25 Chad Perrin (Guest)
on 2006-01-05 03:33
(Received via mailing list)
On Thu, Jan 05, 2006 at 06:39:26AM +0900, Juergen Fiedler wrote:
> long list ending with
I get a list of 27 different dependencies, myself.


>
> > libkitchensink.so.11 => /usr/lib/libkitchensink.so.11 (0xb782a000)

I'd be highly amused if I saw something called "libkitchensink" in
there, though I'd be far less surprised to see it for a KDE application.


>
> yet it does not appear to use libreadline.

Now that I'm actually looking at it, you're right.

Sorry I wasn't more helpful.  That was the closest comparison that came
to mind.

--
Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]

"Real ugliness is not harsh-looking syntax, but having to
build programs out of the wrong concepts." - Paul Graham
This topic is locked and can not be replied to.