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

75 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA f2bb539459
Manually sync with https://github.com/ruby/open3/pull/22 and related PRs 2023-11-30 12:21:25 +09:00
Burdette Lamar d68e5c6d19 [ruby/open3] [DOC] Open3 doc (https://github.com/ruby/open3/pull/21)
https://github.com/ruby/open3/commit/3bdb402b18
2023-11-21 22:25:28 +00:00
Burdette Lamar 37585fd62a [ruby/open3] [DOC] RDoc for Open3
(https://github.com/ruby/open3/pull/20)

https://github.com/ruby/open3/commit/4c9e7492eb
2023-11-19 02:42:33 +00:00
Burdette Lamar 2524c8b551 [ruby/open3] [DOC] RDoc for Open3
(https://github.com/ruby/open3/pull/19)

https://github.com/ruby/open3/commit/577bee9696
2023-11-16 16:27:41 +00:00
Burdette Lamar 82ce47415b [ruby/open3] [DOC] RDoc for Open3
(https://github.com/ruby/open3/pull/18)

https://github.com/ruby/open3/commit/9f3f5d004c
2023-11-10 17:15:06 +00:00
BurdetteLamar 4c8fac0741 [ruby/open3] [DOC] RDoc for Open3
https://github.com/ruby/open3/commit/0aadba9fe6
2023-09-30 16:58:59 +00:00
Burdette Lamar 20efab0b08 [ruby/open3] [DOC] RDoc for Open3
(https://github.com/ruby/open3/pull/15)

https://github.com/ruby/open3/commit/f3191920aa
2023-09-30 14:26:50 +00:00
BurdetteLamar e05ea03553 [ruby/open3] [DOC] RDoc for Open3
https://github.com/ruby/open3/commit/69f9c49eb4
2023-09-29 17:56:01 +00:00
BurdetteLamar 873a8caf58 [ruby/open3] [DOC] RDoc for Open3
https://github.com/ruby/open3/commit/f1d6988f13
2023-09-29 17:56:01 +00:00
BurdetteLamar 4274ebf0f6 [ruby/open3] [DOC] RDoc for Open3
https://github.com/ruby/open3/commit/a4d9fb99de
2023-09-29 17:56:00 +00:00
BurdetteLamar 536f8d901c [ruby/open3] [DOC] RDoc for Open3
https://github.com/ruby/open3/commit/8c06964d12
2023-09-29 17:56:00 +00:00
BurdetteLamar ef13a49a7f [ruby/open3] [DOC] RDoc for Open3
https://github.com/ruby/open3/commit/457cae3a51
2023-09-28 20:15:58 +00:00
Peter Zhu cc6ffceeec [ruby/open3] [DOC] RDoc for Open3 2023-09-28 14:37:44 -04:00
Burdette Lamar e9bc51966b
[DOC] RDoc for Open3.popen3 (#8521) 2023-09-27 23:02:00 -04:00
Charles Oliver Nutter eb06b37c46
[ruby/open3] Update to match JRuby 9.4
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 19:28:54 +09:00
Charles Oliver Nutter 01febcab3e
[ruby/open3] Add JRuby's Windows (JDK non-native) Open3 support
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
2021-12-09 19:28:54 +09:00
Hiroshi SHIBATA 9b9cbbbc17
Update library versions of the default gems.
They are followed up with
  8fb02b7a97
2020-12-22 21:45:28 +09:00
Nobuyoshi Nakada b2d96abb42 Extract version number from the source
"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.
2020-07-30 19:03:18 +09:00
Jean Boussier adbdf11f94 [open3] only close streams if a block is passed
Ref: 5429deb075

The previous change totally borke `popen2e` in this usage:

```ruby
require 'open3'
stdin, stdout, process = Open3.popen2e("cat")
puts stdout.read
```
2020-06-18 10:00:20 -07:00
Yusuke Endoh 5429deb075 lib/open3.rb: make sure that pipes are closed
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>
```
2020-05-27 00:20:14 +09:00
akr c8cb0565a1 open3.rb don't use keyword splat (**).
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-12-12 06:48:46 +00:00
kazu cb67e0bd9c Use `&.` instead of modifier if
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-30 10:01:08 +00:00
akr 3d9453994c lib/open3.rb: accept IO-like object for :stdin_data argument.
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
2017-10-21 07:00:58 +00:00
normal e3c2885698 lib/open3: favor symbol proc when possible
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-21 23:13:16 +00:00
normal f845a9ef76 lib/*: remove closed checks
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
2016-11-21 23:05:41 +00:00
akr 1ec544695f * lib/open3.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-14 07:43:23 +00:00
nobu e247d9e145 open3.rb: Hash.try_convert
* 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-08 03:52:01 +00:00
akr 1ade9cad02 * lib/open3.rb: Open3 properly passes non-keyword hash args to spawn.
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
2015-01-07 15:29:28 +00:00
hsbt 91dd80fac7 * lib/open3.rb: fix code formatting in documentation by @JoshCheek
[fix GH-747][ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-04 03:09:28 +00:00
hsbt ffc068c9bb * lib/cgi/session/pstore.rb: separated sample code.
* lib/open3.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-10 01:34:50 +00:00
glass fd7a02f960 * lib/open3.rb: avoid unnecessary write if stdin_data is empty.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-07 14:31:54 +00:00
akr 14ad015896 * lib/open3.rb (Open3.capture3): Ignore Errno::EPIPE for writing
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
2014-03-01 10:56:39 +00:00
a_matsuda 64ac49e6fe * lib/open3.rb: [DOC] Fix typo (s/thumnail/thumbnail/)
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-01 03:13:11 +00:00
glass 53dc9794f0 * lib/open3.rb: receive arguments as keyword arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-08 09:41:55 +00:00
duerst d5f642ecc7 lib/open3.rb: tweaked grammar in comments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-06 07:32:56 +00:00
zzak 59edab809e * lib/open3.rb : Typo in Open3 overview. Patch by zed_0xff
[Github Fixes #233]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-13 04:40:15 +00:00
akr 48c7c84e46 update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-17 01:17:23 +00:00
ktsj c3749b6a6d * ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,
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-11-05 07:37:47 +00:00
akr be561cbebe update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24 11:08:52 +00:00
akr 454de1d5eb update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 12:18:50 +00:00
drbrain 7bbf2f3085 * lib: Convert tabs to spaces for ruby files per
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
2011-05-18 21:19:18 +00:00
akr 9c18840667 fix doc again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-02 15:01:54 +00:00
akr fc90d4a109 fix doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-02 14:58:16 +00:00
akr f828d53066 update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-28 01:50:49 +00:00
akr 3266ec1658 * lib/open3.rb (Open3.pipeline_start): return an array of threads if a
block is not given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-10 17:24:42 +00:00
akr ca138145f5 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-08 17:00:44 +00:00
akr 920ea359ba rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-07 12:35:11 +00:00
akr 7c20c4ec02 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-07 10:34:25 +00:00
akr c0264efadd * lib/open3.rb (Open3.capture3): renamed from Open3.poutput3.
(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 08:45:31 +00:00
akr 1de2a15aaf * lib/open3.rb (Open3.poutput3): :binmode option implemented.
(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-07 02:49:18 +00:00