aboutsummaryrefslogtreecommitdiffstats
path: root/ext/io
Commit message (Collapse)AuthorAgeFilesLines
* wait readable/writablenobu2016-01-241-3/+74
| | | | | | | | * ext/io/wait/wait.c (io_wait_readwrite): [EXPERIMENTAL] allow to wait for multiple modes, readable and writable, at once. the arguments may change in the future. [Feature #12013] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io/console: fix gem build failure on Windowsnobu2015-12-233-3/+9
| | | | | | | | | | | * ext/io/console/extconf.rb: fix gem build failure on Windows. only win32_vk.inc is included in the gem and no dependencies for the header, so that gperf will not be mandatory. [ruby-core:72453] [Bug #11866] * ext/io/console/io-console.gemspec: include depend file and win32_vk header. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prefer rb_syserr_failnobu2015-12-231-2/+1
| | | | | | | | * file.c, io.c, util.c: prefer rb_syserr_fail with saved errno over setting errno then call rb_sys_fail, not to be clobbered potentially and to reduce thread local errno accesses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io-console.gemspec: BSD-2-Clausenobu2015-12-221-1/+1
| | | | | | | * ext/io/console/io-console.gemspec: change the license to BSD-2-Clause since "ruby" is no longer valid license as gem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io-console.gemspec: bump upnobu2015-12-221-1/+1
| | | | | | * ext/io/console/io-console.gemspec: bump up to 0.4.4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* handle ext/ as r53141naruse2015-12-164-0/+4
| | | | | | | | g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&# frozen_string_literal: false\n");f.rewind;f.write s}}' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* retry IO#getpassnobu2015-12-082-0/+87
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r52902,r52903,r52910,r52911,r52937,r52939naruse2015-12-081-76/+1
| | | | | | Reject IO::Console#getpass because it can't test portablly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: prompt to stderrnobu2015-12-061-9/+2
| | | | | | | * ext/io/console/console.c (console_getpass): print prompt to stderr when reading from stdin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: console_getpassnobu2015-12-061-1/+83
| | | | | | | * ext/io/console/console.c (console_getpass): add IO#getpass method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: check unused argsnobu2015-11-071-2/+6
| | | | | | | * ext/io/console/console.c (console_set_winsize): unused arguments also should be nil or integers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext: use RARRAY_CONST_PTRnobu2015-11-041-2/+4
| | | | | | | * ext/bigdecimal/bigdecimal.c: use RARRAY_CONST_PTR just fore reference instead of RARRAY_PTR, to keep the array WB-protected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32_vk.inc: merge win32_vk.hnobu2015-09-024-491/+489
| | | | | | | * ext/io/console/win32_vk.inc: merge win32_vk.h not to be included in HDRS on other platforms than Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io/console/extconf.rb: fix typonobu2015-07-271-2/+2
| | | | | | | * ext/io/console/extconf.rb: fix typo, $nmake is "m" for MS, not "n". check sys/ioctl.h iff necessary for tty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: undefined vknobu2015-07-213-3/+493
| | | | | | | * ext/io/console/console.c (console_key_pressed_p): raise undefined virtual key code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/io/console/depend (.list.chksum): revert a part of r50859, becauseusa2015-06-131-1/+1
| | | | | | | | it was not mentioned at its commit log and it caused a build error on Windows ($(MAKE) is already quoted). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.gemspec: Fix require paths for released gem.hsbt2015-06-131-1/+1
| | | | | | | [fix GH-929] Patch by @voxik * ext/io/console/io-console.gemspec: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32_vk.inc: suppress warningsnobu2015-06-132-164/+166
| | | | | | | * ext/io/console/depend (win32_vk.inc): use offsetof() to suppress warnings against cast from pointer to integer of different size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* nonblock.c: just yield if the flag is not changednobu2015-05-181-4/+6
| | | | | | | | | | * ext/io/nonblock/nonblock.c (io_nonblock_set): return whether nonblock flag was changed. * ext/io/nonblock/nonblock.c (rb_io_nonblock_block): nothing to restore but just yield unless nonblock flag is changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extconf.rb: no nmake style VPATHnobu2015-05-082-3/+1
| | | | | | * ext/io/console/extconf.rb: only nmake needs remove style VPATH. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* depend: no nmake style VPATHnobu2015-05-081-2/+2
| | | | | | * ext/io/console/depend: remove nmake style VPATH, for normal makes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* checksum.rb: check the targetnobu2015-05-071-1/+1
| | | | | | | * tool/checksum.rb (Checksum#update?): check if the target exists too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32_vk.inc: renamednobu2015-05-073-5/+5
| | | | | | | * ext/io/console/win32_vk.inc: renamed not to be included in HDRS by mkmf.rb and regenerated unexpectedly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io/console: win32_vk dependenciesnobu2015-05-063-3/+13
| | | | | | | * ext/io/console/depend: check if VK table is modified by the checksum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io/console: vk_header only on Windowsnobu2015-05-051-2/+2
| | | | | | | * ext/io/console/extconf.rb: vk_header is used only on Windows, nonsense to update on other platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: pressed? on Windowsnobu2015-05-035-1/+1122
| | | | | | | * ext/io/console/console.c (console_key_pressed_p): new method IO#pressed? on Windows. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: cursor position on Windowsnobu2015-05-031-0/+49
| | | | | | | | | | | | | * ext/io/console/console.c (console_goto): new method IO#goto on Windows. [EXPERIMENTAL] * ext/io/console/console.c (console_cursor_pos): new method IO#cursor on Windows. [EXPERIMENTAL] * ext/io/console/console.c (console_cursor_set): new method IO#cursor= on Windows. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: IO#beepnobu2015-05-031-0/+19
| | | | | | | * ext/io/console/console.c (console_beep): new method IO#beep. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: remove old ifdefnobu2015-05-031-4/+0
| | | | | | | * ext/io/console/console.c (LAST_ERROR): remove old ifdef, should use rb_w32_map_errno always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* wait.c: no EOFnobu2015-04-121-10/+8
| | | | | | | * ext/io/wait/wait.c (io_wait_readable): simply returns that IO is readable without blocking, but no longer returns EOF. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* wait.c: poll over nreadnobu2015-04-121-9/+9
| | | | | | | | * ext/io/wait/wait.c (io_ready_p, io_wait_readable): try polling first and check FIONREAD optionally to see if EOF. [ruby-core:36805] [Feature #4849] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* wait.c: fix rdocnobu2015-04-121-2/+2
| | | | | | | * ext/io/wait/wait.c (io_wait_writable): fix rdoc. no EOF to write. retursn nil when timeout, not self. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* wait.c: wait_for_single_fdnobu2015-04-121-11/+13
| | | | | | | * ext/io/wait/wait.c (wait_for_single_fd): extract wrapper function of rb_wait_for_single_fd(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* wait.c: get_timeoutnobu2015-04-121-20/+16
| | | | | | | * ext/io/wait/wait.c (get_timeout): extract function to get timeout value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: winsize on Windowsnobu2015-03-211-10/+8
| | | | | | | | | | | | * ext/io/console/console.c (console_set_winsize): use handle for writing. GetConsoleScreenBufferInfo seems failing on a handle for reading. * io.c: [DOC] update the example of IO#winsize to use $stdout instead of $stdin, which does not work on Windows. a patch by Jan Lelis <mail AT janlelis.de> at [ruby-core:68574]. [Bug #10986] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io/wait: fix return value for buffered readnormal2015-03-011-1/+1
| | | | | | | | | | * 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
* console.c: use static IDsnobu2015-02-161-4/+6
| | | | | | * 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
* console.c: avoid inadvertent pindownnobu2015-02-161-5/+25
| | | | | | | * 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
* console.c: fix typonobu2015-02-161-2/+2
| | | | | | | * 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
* console.c: IO.console arguments passingnobu2014-12-251-8/+35
| | | | | | | | | | * 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
* console.c: get rid of NameErrornobu2014-12-251-1/+1
| | | | | | | * 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
* io/console: checks for old versionsnobu2014-12-181-4/+4
| | | | | | | * 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
* io-console.gemspec: bump upnobu2014-12-171-1/+1
| | | | | | * 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
* console.c: dead codenobu2014-12-172-56/+0
| | | | | | * 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
* * win32/win32.c, include/win32/win32.h (rb_w32_set_nonblock): newusa2014-11-101-1/+4
| | | | | | | | | | | | | | | | | | | | 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
* protoize no-arguments functionsnobu2014-09-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/io/console/console.c (console_dev): need read access for conout$usa2014-02-221-1/+1
| | | | | | | because some functions need it. [Bug#9554] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io-console.gemspec: certificationnobu2013-11-131-0/+2
| | | | | | | * 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
* * ext/io/nonblock/nonblock.c: [DOC] Document io/nonblock by reprahzzak2013-10-161-0/+23
| | | | | | | | [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
* * ext/io/nonblock/nonblock.c: use rb_cIO instead of VALUEzzak2013-10-161-5/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e