Forum: Ruby Ncurses like library?

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.
Tim M. (Guest)
on 2009-01-14 18:32
Excuse me, but does anyone know of an Ncurses-like library for Ruby? For
putting graphics made with static text onto a terminal/DOS window?
Jesús Gabriel y Galán (Guest)
on 2009-01-14 18:40
(Received via mailing list)
On Wed, Jan 14, 2009 at 5:31 PM, Tim M. <removed_email_address@domain.invalid> 
wrote:
> Excuse me, but does anyone know of an Ncurses-like library for Ruby? For
> putting graphics made with static text onto a terminal/DOS window?

Hi, this might help:

http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1

Jesus.
Andy C. (Guest)
on 2009-01-14 18:44
(Received via mailing list)
> Hi, this might help:
>
> http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1
>
> Jesus.

Why is it that site never gets old?
Especially when it comes to the 2-3 Ncurses questions a day.
Tim M. (Guest)
on 2009-01-14 18:50
Andy C. wrote:
>> Hi, this might help:
>>
>> http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1
>>
>> Jesus.
>
> Why is it that site never gets old?
> Especially when it comes to the 2-3 Ncurses questions a day.

Yeah, that ruby-ncurses binding isn't the best, lots of methods are
missing and other little things (like 'include Ncurses' not working
correctly). Any OTHER TUI libraries?
Michal S. (Guest)
on 2009-01-14 19:00
(Received via mailing list)
2009/1/14 Tim M. <removed_email_address@domain.invalid>:
> Yeah, that ruby-ncurses binding isn't the best, lots of methods are
> missing and other little things (like 'include Ncurses' not working
> correctly). Any OTHER TUI libraries?

If you look through the forum somebody suggested curses FFI bindings I
think but I don't know how far that got.

If you find the ruby curses bindings insufficient, post about its
deficiencies so that they can be worked out.

I personally do not use them because they cannot do multibyte
characters but that's not limitation of these bindings but of the
version 1.8 of the Ruby interpreter - it cannot use locales correctly.

Thanks

Michal
Tim M. (Guest)
on 2009-01-14 19:03
Michal S. wrote:
> 2009/1/14 Tim M. <removed_email_address@domain.invalid>:
>> Yeah, that ruby-ncurses binding isn't the best, lots of methods are
>> missing and other little things (like 'include Ncurses' not working
>> correctly). Any OTHER TUI libraries?
>
> If you look through the forum somebody suggested curses FFI bindings I
> think but I don't know how far that got.
I'll look into that, thanks.

>
> If you find the ruby curses bindings insufficient, post about its
> deficiencies so that they can be worked out.
I thought Ruby-Ncurses development was dead?

>
> I personally do not use them because they cannot do multibyte
> characters but that's not limitation of these bindings but of the
> version 1.8 of the Ruby interpreter - it cannot use locales correctly.
>
> Thanks
>
> Michal
Jesús Gabriel y Galán (Guest)
on 2009-01-14 19:06
(Received via mailing list)
On Wed, Jan 14, 2009 at 5:49 PM, Tim M. <removed_email_address@domain.invalid> 
wrote:
> Yeah, that ruby-ncurses binding isn't the best, lots of methods are
> missing and other little things (like 'include Ncurses' not working
> correctly). Any OTHER TUI libraries?

Sorry, from the way you worded your question I assumed you wanted to
know if there were any ruby ncurses bindings and I wanted to point out
that some googling might help (admiteddly, I should have clicked the
search, and not the "I'm feeling lucky" button, to show there were
many results). You didn't show that you had already evaluated some
ncurses binding, so I assumed you didn't. My bad.

From the questions in this list it seems there are other people using
the ncurses gem. For example Nit K. posted many questions related
to ncurses, maybe you can take a look at his questions. Also Sean
O'Halpin was working in a FFI wrapper for ncurses which might be
interesting.

Jesus.
Tim M. (Guest)
on 2009-01-14 19:26
Jesús Gabriel y Galán wrote:
> On Wed, Jan 14, 2009 at 5:49 PM, Tim M. <removed_email_address@domain.invalid> wrote:
>> Yeah, that ruby-ncurses binding isn't the best, lots of methods are
>> missing and other little things (like 'include Ncurses' not working
>> correctly). Any OTHER TUI libraries?
>
> Sorry, from the way you worded your question I assumed you wanted to
> know if there were any ruby ncurses bindings and I wanted to point out
> that some googling might help (admiteddly, I should have clicked the
> search, and not the "I'm feeling lucky" button, to show there were
> many results). You didn't show that you had already evaluated some
> ncurses binding, so I assumed you didn't. My bad.
>
> From the questions in this list it seems there are other people using
> the ncurses gem. For example Nit K. posted many questions related
> to ncurses, maybe you can take a look at his questions. Also Sean
> O'Halpin was working in a FFI wrapper for ncurses which might be
> interesting.
>
> Jesus.

http://search.cpan.org/~lunartear/Term-Visual-0.08/Visual.pm
Looks absolutely perfect. I can't find anything related to getting it to
work with Ruby, save for a post asking how to do it here on this list.
No one replied to it. Anyone ever get it to work?
R. K. (Guest)
on 2009-01-15 07:28
Tim M. wrote:
> Excuse me, but does anyone know of an Ncurses-like library for Ruby? For
> putting graphics made with static text onto a terminal/DOS window?

I am surprised to hear that ncurses-ruby is not working or the include
Ncurses is not working.

All my work uses ruby-ncurses as a base. Yes, there are a couple of
things I have come across that were buggy - which I have pointed out on
this forum.
Sadly there seems to be no maintainer for it -- have posted bugs but no
response. But these are very minor and probably no one uses those
things.

Please install the gem and then try the samples. Feel free to ask me
anything - I just might be able to help and save you time, and am glad
to answer.

oh, btw, just wondering -- is the basic curses that comes with ruby
working on your system.

Also, I believe I have done extensive and thorough searching on ncurses
and ruby  (2 months ago) and whatever libraries or wrappers I could find
were long abandoned or had not released code.

Cheers,
Sent.
Michal S. (Guest)
on 2009-01-15 13:11
(Received via mailing list)
2009/1/14 Tim M. <removed_email_address@domain.invalid>:
>>
>> If you find the ruby curses bindings insufficient, post about its
>> deficiencies so that they can be worked out.
> I thought Ruby-Ncurses development was dead?

I meant the ruby curses extension that is included in stdlib.

It is probably not developed very actively but if you find some
limitations that can be resolved without introducing incompatibilities
(or in any reasonable way for 1.9) there is a good chance that such
change will be included.

Thanks

Michal
Phlip (Guest)
on 2009-01-15 16:51
(Received via mailing list)
Ruby R. wrote:

> All my work uses ruby-ncurses as a base.

Can you use it in an existing console, such as to simply color text,
without
pretending it's a window and taking over all of it?
Michal S. (Guest)
on 2009-01-15 17:01
(Received via mailing list)
2009/1/15 Phlip <removed_email_address@domain.invalid>:
> Ruby R. wrote:
>
>> All my work uses ruby-ncurses as a base.
>
> Can you use it in an existing console, such as to simply color text, without
> pretending it's a window and taking over all of it?
>

I guess that's not what curses are meant for in general.

You can look up the terminal capabilities and use them to change
colors but curses functions all operate on windows. Curses is a TUI
library, not an output coloring library.

The situation is further complicated on Windows where the 'console' is
very fishy and normally you cannot change the colors with writing
terminal strings, only with Win32API calls.

Thanks

Michal
R. K. (Guest)
on 2009-01-15 17:52
Phlip wrote:
> Ruby R. wrote:
>
>> All my work uses ruby-ncurses as a base.
>
> Can you use it in an existing console, such as to simply color text,
> without
> pretending it's a window and taking over all of it?

I am not exactly certain of what you mean, but have you tried Highline.

It does great coloring, I have run its demos but not really used it. A
lot of people here have used it.

Also, iirc Facets has some module for ANSI-coloring. If i am not
mistaken you can do something like a colored ls output (directory
listing).

So do a give a look at Highline and Facets.
Tj H. (Guest)
on 2009-01-16 02:30
Tim M. wrote:
> Excuse me, but does anyone know of an Ncurses-like library for Ruby? For
> putting graphics made with static text onto a terminal/DOS window?

this might help you as well

http://github.com/visionmedia/commander/tree/master
Tim M. (Guest)
on 2009-01-16 03:27
Tj Holowaychuk wrote:
> Tim M. wrote:
>> Excuse me, but does anyone know of an Ncurses-like library for Ruby? For
>> putting graphics made with static text onto a terminal/DOS window?
>
> this might help you as well
>
> http://github.com/visionmedia/commander/tree/master

Isn't quite what I was looking for, but man does it look neat! =D
R. K. (Guest)
on 2009-01-16 08:34
Tj Holowaychuk wrote:
> Tim M. wrote:
>> Excuse me, but does anyone know of an Ncurses-like library for Ruby? For
>> putting graphics made with static text onto a terminal/DOS window?
>
> this might help you as well
>
> http://github.com/visionmedia/commander/tree/master

Looks really good!
Tj H. (Guest)
on 2009-01-16 09:03
RK Sentinel wrote:
> Tj Holowaychuk wrote:
>> Tim M. wrote:
>>> Excuse me, but does anyone know of an Ncurses-like library for Ruby? For
>>> putting graphics made with static text onto a terminal/DOS window?
>>
>> this might help you as well
>>
>> http://github.com/visionmedia/commander/tree/master
>
> Looks really good!

Thanks! that was my first Ruby library every actually haha, its still a
work in progress but all the major tasks seem pretty solid now, just not
alot of people know about it.
Sean O. (Guest)
on 2009-01-16 15:47
(Received via mailing list)
On Wed, Jan 14, 2009 at 5:05 PM, Jesús Gabriel y
Galán<removed_email_address@domain.invalid> wrote:

> Also Sean O'Halpin was working in a FFI wrapper for ncurses which might be
> interesting.

You can get the work-in-progress here:

  http://github.com/seanohalpin/ffi-ncurses/tree/master

Mostly works (except for macros like getxy on Mac OS/X). See the
./examples directory for usage.

Regards,
Sean
Tim M. (Guest)
on 2009-01-17 02:16
Sean O'halpin wrote:
> On Wed, Jan 14, 2009 at 5:05 PM, Jes�s Gabriel y
> Gal�n<removed_email_address@domain.invalid> wrote:
>
>> Also Sean O'Halpin was working in a FFI wrapper for ncurses which might be
>> interesting.
>
> You can get the work-in-progress here:
>
>   http://github.com/seanohalpin/ffi-ncurses/tree/master
>
> Mostly works (except for macros like getxy on Mac OS/X). See the
> ./examples directory for usage.
>
> Regards,
> Sean

Wow, nice. Makes working with Ncurses that much simpler (no
Ncurses.initscr because the include is busted >_<). Is there a gem for
it?
Rafael G. (Guest)
on 2009-02-12 22:29
Tim M. wrote:
> Sean O'halpin wrote:
>> On Wed, Jan 14, 2009 at 5:05 PM, Jes�s Gabriel y
>> Gal�n<removed_email_address@domain.invalid> wrote:
>>
>>> Also Sean O'Halpin was working in a FFI wrapper for ncurses which might be
>>> interesting.
>>
>> You can get the work-in-progress here:
>>
>>   http://github.com/seanohalpin/ffi-ncurses/tree/master
>>
>> Mostly works (except for macros like getxy on Mac OS/X). See the
>> ./examples directory for usage.
>>
>> Regards,
>> Sean
>
> Wow, nice. Makes working with Ncurses that much simpler (no
> Ncurses.initscr because the include is busted >_<). Is there a gem for
> it?


Has anyone tried this "gem"? --> http://rbcurse.rubyforge.org/
Is registered in "RubyForge" on February 2, but looks good.
This topic is locked and can not be replied to.