Граф коммитов

102 Коммитов

Автор SHA1 Сообщение Дата
normal 26e1ebdc1e io/wait: fix return value for buffered read
* ext/io/wait/wait.c (io_nread): wrap return value with INT2FIX
  Thanks to Yura Sokolov <funny.falcon@gmail.com>
  [ruby-core:68369] [Bug#10923]
* test/io/wait/test_io_wait.rb (test_nread_buffered):
  fix broken test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-01 21:03:22 +00:00
nobu b1cff6b68c console.c: use static IDs
* ext/io/console/console.c (rawmode_opt): prepare static IDs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16 03:43:20 +00:00
nobu 8a29d8bbde console.c: avoid inadvertent pindown
* ext/io/console/console.c (console_dev): call Kernel#__send__
  method to avoid inadvertent pindown.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16 03:43:18 +00:00
nobu 5f9f15365f console.c: fix typo
* ext/io/console/console.c (console_dev): fix typo, should be
  rb_funcallv to call with an argument array.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16 03:27:02 +00:00
nobu 945e4692ca console.c: IO.console arguments passing
* ext/io/console/console.c (console_dev): send the given arguments
  to the opened console.  as a special case, do nothing if :close
  is given.
* test/lib/leakchecker.rb (LeakChecker#check_fd_leak): close if
  console.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-25 07:14:12 +00:00
nobu d8d326c97a console.c: get rid of NameError
* ext/io/console/console.c (console_dev): id_console is not a
  constant name, use rb_const_remove() to get rid of NameError.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-25 01:09:17 +00:00
nobu 3bd4d51149 io/console: checks for old versions
* ext/io/console/extconf.rb: remove no longer needed checks for
  old versions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-18 02:44:56 +00:00
nobu c28e5f0852 io-console.gemspec: bump up
* ext/io/console/io-console.gemspec: bump up to 0.4.3.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-17 08:17:49 +00:00
nobu ee4ca1887a console.c: dead code
* ext/io/console/console.c: remove dead code for old versions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-17 08:17:46 +00:00
usa fd9f6bde95 * win32/win32.c, include/win32/win32.h (rb_w32_set_nonblock): new
function to support nonblock-mode of pipes.

* win32/win32.c (rb_w32_read): nonblock-mode pipe returns ERROR_NO_DATA
  if there is no data, but also returns it if remote-end is closed.

* win32/win32.c (rb_w32_write): if cannot to write any data, it may be
  blocking.

* io.c (rb_io_set_nonblock): use rb_w32_set_nonblock for Windows.

* ext/io/nonblock/nonblock.c (rb_io_nonblock_set): use ruby's API when
  setting nonblock-mode.

* test/ruby/test_io.rb: test nonblock pipes on Windows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 10:42:19 +00:00
nobu 28b9f11d5a protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30 05:25:32 +00:00
usa 64904f51d7 * ext/io/console/console.c (console_dev): need read access for conout$
because some functions need it.  [Bug#9554]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-22 10:11:25 +00:00
nobu 2019f34bc9 io-console.gemspec: certification
* ext/io/console/io-console.gemspec: add a certification.
  http://www.benjaminfleischer.com/2013/11/08/how-to-sign-your-rubygem-cert/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 08:08:09 +00:00
zzak 64afa78e8a * ext/io/nonblock/nonblock.c: [DOC] Document io/nonblock by reprah
[Fixes GH-418] https://github.com/ruby/ruby/pull/418 based on the
  original discussion from documenting-ruby/ruby#18


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 20:54:23 +00:00
zzak 8ead78806c * ext/io/nonblock/nonblock.c: use rb_cIO instead of VALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 13:36:19 +00:00
nobu c59ba9ce81 io-console.gemspec: drop 1.9
* ext/io/console/io-console.gemspec: drop 1.9 support since
  rb_cloexec_open() is mandatory now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-09 13:56:04 +00:00
charliesome ecab690862 * ext/io/console/console.c: delete redefinition of rb_cloexec_open.
This function is always defined by io.c and is declared as non-static
  in a header file, so this declaration causes a compilation error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-09 10:18:56 +00:00
nobu 755f669316 io/console: rdoc
* ext/io/console/console.c (io_getch): add rdoc.

* ext/io/console/lib/console/size.rb (IO.console_size): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24 06:54:25 +00:00
nobu db41a18845 rename generic io modules
* ext/io/console/console.c, ext/stringio/stringio.c: rename internally
  used modules as generic_readable and generic_writable.  [Fix GH-315]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24 06:54:17 +00:00
zzak 3a7a773aeb * ext/socket/option.c: Document synonymous methods, by windwiny [GH-277]
* ext/stringio/stringio.c: ditto
* ext/io/wait/wait.c: ditto
* ext/gdbm/gdbm.c: ditto
* ext/dl/cfunc.c: ditto
* ext/zlib/zlib.c: ditto
* ext/win32ole/win32ole.c: ditto
* ext/dbm/dbm.c: ditto
* ext/json/generator/generator.c: ditto
* ext/date/date_core.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-16 03:25:50 +00:00
akr 788b45da3e * ext/-test-/debug/depend: New file.
* ext/-test-/exception/depend: Ditto.

* ext/-test-/printf/depend: Ditto.

* ext/-test-/string/depend: Ditto.

* ext/coverage/depend: Ditto.

* ext/io/console/depend: Ditto.

* ext/io/nonblock/depend: Ditto.

* ext/io/wait/depend: Ditto.

* ext/openssl/depend: Ditto.

* ext/pathname/depend: Ditto.

* ext/psych/depend: Ditto.

* ext/zlib/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-14 10:48:08 +00:00
nobu 4002be60c0 console.c: supppress warnings
* ext/io/console/console.c (console_iflush, console_oflush): supppress
  unused-but-set-variable warnings on no tcflush.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-16 08:05:45 +00:00
nobu 78b50f26dc io/console: 0.4.2
* ext/io/console/io-console.gemspec: bump to 0.4.2.  now explicitly
  requires ruby 1.9.3 or later.  [Bug #7847]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-16 04:13:07 +00:00
nobu 923b8c4eda io/console: set HAVE_RB_SCAN_ARGS_OPTIONAL_HASH
* ext/io/console/extconf.rb: obtain optional hash by rb_scan_args() by
  default right now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-16 04:00:33 +00:00
nobu 2a62ca666c io/console: fix configuration failure
* ext/io/console/extconf.rb: fix configuration failure by missing
  cpp_include.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-16 03:58:04 +00:00
nobu 6ba2001d72 io/console: compatibility with 1.8
* ext/io/console/console.c (console_dev): compatibility with ruby 1.8.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-16 03:47:21 +00:00
nobu 44c24d4416 io/console: compatibility with 1.9
* ext/io/console/console.c (rawmode_opt, console_dev): compatibility
  with ruby 1.9.  [ruby-core:52220] [Bug #7847]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-16 03:46:34 +00:00
nobu 490f1fc009 console.c: default by stty raw
* ext/io/console/console.c (rawmode_opt): use default values by `stty
  raw`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05 04:27:57 +00:00
nobu d06141cde7 io-console.gemspec: 0.4.1
* ext/io/console/io-console.gemspec: bump to 0.4.1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04 12:23:51 +00:00
nobu 1a15c3770e io-console.gemspec: limit date length
* ext/io/console/io-console.gemspec: limit Date keyword length to get rid of locale format.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04 12:15:32 +00:00
nobu 36ed400fe3 io-console.gemspec: update
* ext/io/console/io-console.gemspec: use Date keyword and add licenses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04 12:09:16 +00:00
nobu 523292d612 console.c: initialize
* ext/io/console/console.c (rawmode_opt): initialize options for the
  case all options are not given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04 06:10:12 +00:00
nobu 80455c0d97 * ext/io/console/io-console.gemspec: fix date.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-03 08:22:43 +00:00
nobu b3d12956b4 io-console.gemspec: bump
* ext/io/console/io-console.gemspec: bump.  [Bug #7762]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-03 07:54:29 +00:00
nobu f050b22327 console.c: fix unit of min
* ext/io/console/console.c (rawmode_opt): min is minimum characters,
  not tenths.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-03 07:54:18 +00:00
nobu 45faa57b49 wait.c: wait_readable
* ext/io/wait/wait.c (io_wait_readable): add alias wait_readable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-21 13:53:02 +00:00
nobu e786aa711d io/wait: add IO#wait_writable method
* ext/io/wait/wait.c (io_wait_writable): this is easier to use than
  IO.select for a single IO object and is immune to the
  limitations/innefficiency of select() on platforms where poll/ppoll
  is available.  patched by Eric Wong.  [Feature #4646]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-21 13:40:00 +00:00
nobu b0dd250dc9 use RB_TYPE_P() instead of comparison of TYPE()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23 07:13:21 +00:00
nobu dd9569ded8 * ext/io/console/console.c (set_rawmode): clear ECHOE and ECHOK
bits too.
* ext/io/console/console.c (echo_p): ignore ECHOE and ECHOK bits.
  [ruby-dev:45309] [Bug #6116]
* ext/io/console/console.c (console_raw): fix rdoc.
* ext/io/console/console.c (console_set_echo): mentioned about
  platform dependency.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 01:11:47 +00:00
nobu 8335ce7065 * ext/io/console/console.c (io_getch): default delegating method
for StringIO.  https://github.com/nobu/io-console/issues/4
* ext/stringio/stringio.c: moved some methods to hidden modules.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-25 18:24:09 +00:00
drbrain 12e7e79727 * io.c (Init_IO): Mention io/console methods. [Ruby 1.9 - Bug #5602]
* ext/io/console/console.c:  Mention that io/console must be required
  similar to lib/time.rb


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-07 01:49:40 +00:00
nobu 714ec98ec4 * ext/io/console/console.c (console_raw, console_set_raw)
(console_getch): optional parameters.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-18 08:18:18 +00:00
nobu 3723ac22d2 * ext/io/console/console.c (console_cooked, console_set_cooked):
new methods to reset cooked mode.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-18 07:12:14 +00:00
akr da74bc7552 * process.c (ruby_setsid): use rb_cloexec_open.
(rb_daemon): ditto.

* ruby.c (load_file_internal): ditto.

* file.c (rb_file_s_truncate): ditto.
  (file_load_ok): ditto.

* random.c (fill_random_seed): ditto.

* ext/pty/pty.c (chfunc): ditto.
  (get_device_once): ditto.

* ext/io/console/console.c (console_dev): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29 04:01:54 +00:00
akr 2bb5441808 * complex.c: use "__sun" instead of "__sun__" to detect SunOS.
* math.c: ditto.

* hash.c: ditto.

* atomic.h: ditto.

* ext/io/wait/wait.c: ditto.

[ruby-dev:44693]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24 14:57:08 +00:00
ngoto d332891fdd * ext/io/wait/wait.c: ioctl(2) is declared in unistd.h on Solaris.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-23 07:51:10 +00:00
akr b574a4d4a1 * include/ruby/intern.h (rb_fd_set_cloexec): declared.
* io.c (rb_fd_set_cloexec): new function.
  (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag.
  (rb_sysopen_internal): ditto.
  (rb_pipe): ditto.
  (io_reopen): ditto.
  (io_cntl): ditto.

* process.c (rb_f_exec): change the default :close_others option to
  true.
  (rb_f_system): ditto.
  (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set
  close-on-exec flag.
  (ruby_setsid): ditto.
  (rb_daemon): ditto.

* thread_pthread.c (rb_thread_create_timer_thread): call
  rb_fd_set_cloexec to set close-on-exec flag.

* ruby.c (load_file_internal): ditto.

* file.c (rb_file_s_truncate): ditto.
  (file_load_ok): ditto.

* random.c (fill_random_seed): ditto.

* ext/pty/pty.c (chfunc): ditto.
  (get_device_once): ditto.

* ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.

* ext/socket/init.c (rsock_socket): ditto.
  (rsock_s_accept_nonblock): ditto.
  (rsock_s_accept): ditto.

* ext/socket/socket.c (rsock_sock_s_socketpair): ditto.

* ext/socket/ancdata.c (discard_cmsg): ditto.
  (make_io_for_unix_rights): ditto.

* ext/socket/unixsocket.c (unix_recv_io): ditto.

* ext/io/console/console.c (console_dev): ditto.

[ruby-core:38140] [Feature #5041]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-22 09:58:15 +00:00
nobu e6ce15c68a * ext/bigdecimal/bigdecimal.gemspec (files): fixed typo, and
removed nonexistent file.
* ext/bigdecimal/bigdecimal.gemspec (homepage): added.
* ext/io/console/io-console.gemspec (homepage): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-16 10:46:30 +00:00
nobu 4ac511266d * ext/io/console/console.c (console_set_winsize): remove
unused variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 14:54:14 +00:00
nobu 72276eb06b * remove unused variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 15:49:36 +00:00