Skip to content

Commit

Permalink
[DOC] Show PTY.getpty as an alias of PTY.spawn
Browse files Browse the repository at this point in the history
`:nodoc:` directive does not work at method definition in C, and must
be at the implementation function.  That is, there is no way to make
one method visible and another method sharing the implementation
invisible at the same time.
  • Loading branch information
nobu committed Dec 18, 2023
1 parent 835f146 commit baf1403
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ext/pty/pty.c
Expand Up @@ -745,8 +745,13 @@ void
Init_pty(void)
{
cPTY = rb_define_module("PTY");
/* :nodoc: */
rb_define_module_function(cPTY,"getpty",pty_getpty,-1);
#if 1
rb_define_module_function(cPTY,"get""pty",pty_getpty,-1);
#else /* for RDoc */
/* show getpty as an alias of spawn */
VALUE sPTY = rb_singleton_class(cPTY);
rb_define_alias(sPTY, "getpty", "spawn");
#endif
rb_define_module_function(cPTY,"spawn",pty_getpty,-1);
rb_define_singleton_method(cPTY,"check",pty_check,-1);
rb_define_singleton_method(cPTY,"open",pty_open,0);
Expand Down

0 comments on commit baf1403

Please sign in to comment.