1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/pty
matz 948ff2456b * signal.c (sighandle): should not re-register sighandler if
POSIX_SIGNAL is defined.

* eval.c (error_print): errat array may be empty.

* eval.c (rb_eval_cmd): should not upgrade safe level unless
  explicitly specified by argument newly added.

* signal.c (sig_trap): should not allow tainted trap closure.

* variable.c (rb_f_trace_var): should not allow trace_var on safe
  level higher than 3.

* variable.c (rb_f_trace_var): should not allow tainted trace
  closure.

* gc.c: do not use static stack until system stack overflows.

* eval.c (eval): should call Exception#exception instead of
  calling rb_exc_new3() directly.

* error.c (exc_exception): set "mesg" directly to the clone.  it
  might be better to set mesg via some method for flexibility.

* variable.c (cvar_override_check): should print original module
  name, if 'a' is T_ICLASS.

* parse.y (yylex): float '1_.0' should not be allowed.

* variable.c (var_getter): should care about var as Qfalse
  (ruby-bugs#PR199).

* array.c (cmpint): <=> or block for {min,max} may return bignum.

* array.c (sort_1): use rb_compint.

* array.c (sort_2): ditto.

* enum.c (min_ii): ditto.

* enum.c (min_ii): ditto.

* enum.c (max_i): ditto.

* enum.c (max_ii): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-13 08:14:27 +00:00
..
lib * error.c (exc_exception): clone the receiver exception instead of 2001-07-02 08:46:28 +00:00
.cvsignore Add .cvsignore's. 2001-01-09 17:11:36 +00:00
depend ext/*/depend 1999-10-21 07:08:00 +00:00
expect_sample.rb remove marshal/gtk/kconv 1999-08-13 05:37:52 +00:00
extconf.rb * win32/win32.c (win32_stat): UNC support. 2001-03-20 14:50:43 +00:00
MANIFEST Rename *.jp to *.ja, since jp is a region code and ja is a language 2001-07-19 05:44:26 +00:00
pty.c * signal.c (sighandle): should not re-register sighandler if 2001-11-13 08:14:27 +00:00
README remove marshal/gtk/kconv 1999-08-13 05:37:52 +00:00
README.expect remove marshal/gtk/kconv 1999-08-13 05:37:52 +00:00
README.expect.ja Rename *.jp to *.ja, since jp is a region code and ja is a language 2001-07-19 05:44:26 +00:00
README.ja Rename *.jp to *.ja, since jp is a region code and ja is a language 2001-07-19 05:44:26 +00:00
script.rb 1.4.1 to be 1999-08-24 08:21:56 +00:00
shl.rb remove marshal/gtk/kconv 1999-08-13 05:37:52 +00:00

pty extension version 0.3 by A.ito

1. Introduction

This extension module adds ruby a functionality to execute an 
arbitrary command through pseudo tty (pty).

2. Install

Follow the instruction below.

(1) Execute

      ruby extconf.rb

    then Makefile is generated.

(3) Do make; make install.

3. What you can do

This extension module defines a module named PTY, which contains
following module fungtions:

   getpty(command)
   spawn(command)

      This function reserves a pty, executes command over the pty 
      and returns an array. The return value is an array with three
      elements. The first element in the array is for reading and the 
      second for writing. The third element is the process ID of the
      child process. If this function is called with an iterator block,
      the array is passed to the block as block parameters, and the
      function itself returns nil.

      While the process spawned by this function is active, SIGCHLD
      is captured to handle the change of the child process. When the
      child process is suspended or finished, an exception is raised.
      As all SIGCHLD signal is captured and processed by PTY module,
      you can't use other function or method which spawns subprosesses
      (including signal() and IO.popen()) while the PTY subprocesses
      are active. Otherwise, unexpected exception will occur. To avoid
      this problem, see protect_signal() below.

      If this function is called with an iterator block, SIGCHLD signal
      is captured only within the block. Therefore, it is risky to use
      File objects for PTY subprocess outside the iterator block.


   protect_signal

      This function takes an iterator block. Within the iterator block,
      no exception is raised even if any subprocess is terminated.
      This function is used to enable functions like system() or IO.popen()
      while PTY subprocess is active. For example,

        PTY.spawn("command_foo") do |r,w|
          ...
          ...
          PTY.protect_signal do
            system "some other commands"
          end
          ...
        end

      disables to send exception when "some other commands" is 
      terminated. 

    reset_signal

      Disables to handle SIGCHLD while PTY subprocess is active.


4. License

(C) Copyright 1998 by Akinori Ito.

This software may be redistributed freely for this purpose, in full 
or in part, provided that this entire copyright notice is included 
on any copies of this software and applications and derivations thereof.

This software is provided on an "as is" basis, without warranty of any
kind, either expressed or implied, as to any matter including, but not
limited to warranty of fitness of purpose, or merchantability, or
results obtained from use of this software.

5. Bug report

Please feel free to send E-mail to

   aito@ei5sun.yz.yamagata-u.ac.jp

for any bug report, opinion, contribution, etc.