On Jul 7, 2008, at 02:19 AM, Kirill A. Shutemov wrote:
> On Mon, Jul 07, 2008 at 10:25:42AM +0200, Marc Haisenko wrote:
>> On Sunday 06 July 2008, Kirill A. Shutemov wrote:
>>> Is it possible to add ncurses-specific functions to curses ruby  
>>> module?
>>> I'm interested in use_default_colors() and assume_default_colors().
>>> According to man page, these routines are specific to ncurses.
>>>
>>> I have found the patch that add this functionality -- [ruby-core: 
>>> 11843],
>>> but nobody has answered to the message.
>>
>> IMHO that's what the "ncurses-ruby" module is for. For example,  
>> OpenSolaris
>> has curses, not ncurses, so the Ruby default module should work  
>> there as well
>> while it's acceptable that an optional module does not (unless you  
>> install
>> ncurses, of course).
>
> It's possible to export ncurses-specific interface conditionally, like
> color or mouse support. Or we can call rb_notimplement(), if the  
> call is
> not available for this system. Or we can localize ncurses-specific
> functions in separate module and include it if needed.
> I think support ncurses out of box is very useful. External module  
> is not
> suitable for a small application distribution.

I think having ncurses-specific interfaces in the ruby curses is ok.   
Ruby already conditionally provides extensions to the dbm module  
depending on if you have dbm or gdbm or whatever installed.

There's also a bunch of conditional constants in Syslog which you must  
be platform-aware to work around.  I could dig around and find others,  
I am sure.