summaryrefslogtreecommitdiff
path: root/lib/open3.rb
AgeCommit message (Collapse)Author
2021-12-09[ruby/open3] Update to match JRuby 9.4Charles Oliver Nutter
This allows the wrapper functions in the main open3 to be defined while using our ProcessBuilder logic for the internal popen implementation. Note this adds logic to reject redirects from a numeric fd to a live IO object (or not a String or to_path object) since we cannot support direct IO redirects with ProcesBuilder. This patch allows tests to complete with the ProcessBuilder impl. Only three tests fail: * test_numeric_file_descriptor2 and test_numeric_file_descriptor2 fail due to redirecting streams to a pipe IO. * test_pid fails expecting a real PID which we cannot provide via ProcessBuilder. https://github.com/ruby/open3/commit/73f986c233
2021-12-09[ruby/open3] Add JRuby's Windows (JDK non-native) Open3 supportCharles Oliver Nutter
This adds JRuby's logic used on platforms where we do not have native access to posix_spawn and related posix functions needed to do fully-native subprocess launching and management. The code here instead uses the JDK ProcessBuilder logic to simulate most of the Open3 functionality. This code does not pass all tests, currently, but provides most of the key functionality on pure-Java (i.e. no native FFI) platforms. https://github.com/ruby/open3/commit/689da19c42
2020-12-22Update library versions of the default gems.Hiroshi SHIBATA
They are followed up with https://github.com/ruby/ruby/commit/8fb02b7a97317090e3946e6f2d4a7d034f9699f1
2020-07-30Extract version number from the sourceNobuyoshi Nakada
"requiring version.rb" strategy has some issues. - cannot work when cross-compiling - often introduces wrong namespace - must know the superclasses - costs at each runtime than at build-time etc. Notes: Merged: https://github.com/ruby/ruby/pull/3375
2020-06-18[open3] only close streams if a block is passedJean Boussier
Ref: 5429deb075beb9a2b67adae269bbac16325876d1 The previous change totally borke `popen2e` in this usage: ```ruby require 'open3' stdin, stdout, process = Open3.popen2e("cat") puts stdout.read ``` Notes: Merged: https://github.com/ruby/ruby/pull/3236
2020-05-27lib/open3.rb: make sure that pipes are closedYusuke Endoh
Attempting to invoke a non-existent command led to the leak of fds. http://rubyci.s3.amazonaws.com/graviton2/ruby-master/log/20200526T140004Z.log.html.gz ``` [ 9101/20195] TestGemExtCmakeBuilder#test_self_build = 0.01 sLeaked file descriptor: TestGemExtCmakeBuilder#test_self_build: 7 : #<IO:fd 7> Leaked file descriptor: TestGemExtCmakeBuilder#test_self_build: 10 : #<IO:fd 10> Leaked file descriptor: TestGemExtCmakeBuilder#test_self_build: 11 : #<IO:fd 11> Leaked file descriptor: TestGemExtCmakeBuilder#test_self_build: 12 : #<IO:fd 12> ```
2018-12-12open3.rb don't use keyword splat (**).akr
revert r43582, r49173 and r49177. open3 arguments uses spawn-like keyword arguments. Both symbol and integer keys are used. ``` Open3.capture2(*command, :in => IO::NULL, 3 => IO::NULL) `` This style cannot be supported with keyword splat (**) since Ruby 2.6. Because Ruby 2.6 prohibits symbol/non-symbol key hash separation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-30Use `&.` instead of modifier ifkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21lib/open3.rb: accept IO-like object for :stdin_data argument.akr
Open3.capture3, Open3.capture2, Open3.capture2e accepts IO-like object for :stdin_data argument. [ruby-core:80936] [Feature #13527] proposed by janko. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-21lib/open3: favor symbol proc when possiblenormal
It reduces both human and machine code; as well as reducing the confusion from variable naming. * lib/open3.rb (popen_run, pipeline, pipeline_run): avoid capture git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-21lib/*: remove closed checksnormal
Follow r56795. Since Ruby 2.2, calling #close on a closed socket no longer raises exceptions. * lib/cgi/session.rb (update): remove closed? check * lib/net/http.rb (finish, transport_request): ditto * lib/net/imap.rb (disconnect): ditto * lib/net/pop.rb (do_start, do_finish): ditto * lib/net/smtp.rb (do_start, do_finish): ditto * lib/open3.rb (popen_run, pipeline_run): ditto * lib/pstore.rb (transaction): ditto * lib/shell/process-controller.rb (sfork): * lib/tempfile (_close, call, Tempfile.create): ditto * lib/webrick/httpauth/htdigest.rb (flush): ditto * lib/webrick/httpauth/htpasswd.rb (flush): ditto * lib/webrick/server.rb (start_thread, cleanup_shutdown_pipe): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-14* lib/open3.rb: Specify frozen_string_literal: true.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-08open3.rb: Hash.try_convertnobu
* lib/open3.rb (popen_run): use Hash.try_convert for duck typing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-07* lib/open3.rb: Open3 properly passes non-keyword hash args to spawn.akr
Fixed by Josh Cheek. [Fix GH-808] Related to [ruby-core:67347] [Bug #10699] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-04* lib/open3.rb: fix code formatting in documentation by @JoshCheekhsbt
[fix GH-747][ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-10* lib/cgi/session/pstore.rb: separated sample code.hsbt
* lib/open3.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-07* lib/open3.rb: avoid unnecessary write if stdin_data is empty.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-01* lib/open3.rb (Open3.capture3): Ignore Errno::EPIPE for writingakr
stdin_data. (Open3.capture2): Ditto. (Open3.capture2e): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-01* lib/open3.rb: [DOC] Fix typo (s/thumnail/thumbnail/)a_matsuda
[ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-08* lib/open3.rb: receive arguments as keyword arguments.glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-06lib/open3.rb: tweaked grammar in commentsduerst
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-13* lib/open3.rb : Typo in Open3 overview. Patch by zed_0xffzzak
[Github Fixes #233] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-17update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05* ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,ktsj
ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb, lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb, lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb, lib/rinda/tuplespace.rb, lib/rss/maker/base.rb, lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb, lib/shell/command-processor.rb, lib/shell/process-controller.rb, lib/shell/system-command.rb, lib/uri/common.rb: remove unused block arguments to avoid creating Proc objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18 * lib: Convert tabs to spaces for ruby files perdrbrain
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style Patch by Steve Klabnik [Ruby 1.9 - Bug #4730] Patch by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-02fix doc again.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-02fix doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-28update rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-10* lib/open3.rb (Open3.pipeline_start): return an array of threads if aakr
block is not given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-08rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-07rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-07rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-07* lib/open3.rb (Open3.capture3): renamed from Open3.poutput3.akr
(Open3.capture2): renamed from Open3.poutput2. (lOpen3.capture2e): renamed from Open3.poutput2e. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-07* lib/open3.rb (Open3.poutput3): :binmode option implemented.akr
(Open3.poutput2): ditto. (Open3.poutput2e): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-06update rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05* lib/open3.rb (Open3.pipeline_start): new method.akr
(Open3.pipeline): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04update rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04* lib/open3.rb (Open3.poutput3): new method.akr
(Open3.poutput2): ditto. (Open3.poutput2e): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04* lib/open3.rb (Open3.popen3): simplified.akr
(Open3.popen_run): extracted from Open3.popen3. (Open3.popen2): new method. (Open3.popen2e): new method. (Open3.pipeline_rw): new method. (Open3.pipeline_r): new method. (Open3.pipeline_w): new method. (Open3.pipeline_run): new private method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-02* lib/open3.rb (Open3.popen3): merge hash options if given. akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-20* process.c (rb_detach_process): store detached process ID in thenobu
thread local storage. moved from lib/open3.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26* lib/open3.rb (Open3.popen3w): removed.akr
(Open3.popen3): notice wait_thr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26describe about waiting a child process.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26describe :pid thread variable.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26* lib/open3.rb: double fork is replaced by spawn with Process.detach.akr
(Open3.popen3w): new method to access the thread returned by Process.detach. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-09* lib/parsedate.rb: documentation patch from Konrad Meyermatz
<konrad.meyer@gmail.com>. [ruby-doc:1238] * lib/open3.rb, lib/ping.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-04Documentation cleanup.drbrain
Includes patches by Hugh Sasse: * ping.rb * weakref.rb * mailread.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e