<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/test_tempfile.rb, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/tempfile] Support anonymous tempfile on earlier than Ruby 3.2</title>
<updated>2024-08-26T02:49:02+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-08-23T15:37:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=136cbf04419acf993357701e54712f921a294355'/>
<id>136cbf04419acf993357701e54712f921a294355</id>
<content type='text'>
https://github.com/ruby/tempfile/commit/7052805029
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/tempfile/commit/7052805029
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tempfile] File.new(fileno, mode: mode, path: path) is provided from Ruby 3.2</title>
<updated>2024-08-23T06:07:40+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-08-23T05:58:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7812732e2c271732b96e285584ba84eb236c647a'/>
<id>7812732e2c271732b96e285584ba84eb236c647a</id>
<content type='text'>
https://github.com/ruby/tempfile/commit/67ce897727
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/tempfile/commit/67ce897727
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tempfile] Fix subprocess tests requires</title>
<updated>2024-08-20T18:37:53+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-08-20T18:35:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bd7eda6038ab8b8b7536827ead25c1901e6dfa77'/>
<id>bd7eda6038ab8b8b7536827ead25c1901e6dfa77</id>
<content type='text'>
Using `-rtempfile` requires the tempfile built into Ruby, not the
currently developed one, so the tests aren't testing this tempfile.

https://github.com/ruby/tempfile/commit/ea2dec6f46
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using `-rtempfile` requires the tempfile built into Ruby, not the
currently developed one, so the tests aren't testing this tempfile.

https://github.com/ruby/tempfile/commit/ea2dec6f46
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tempfile] Add FinalizerManager to manage finalizers</title>
<updated>2024-08-20T18:07:42+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-08-20T17:28:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a68331e7036d7ab433778bf65eb854aabd5009c4'/>
<id>a68331e7036d7ab433778bf65eb854aabd5009c4</id>
<content type='text'>
As @jeremyevans pointed out for commit eb2d8b1:

&gt; Each Tempfile instance has a separate File instance and file descriptor:
&gt;
&gt;   t = Tempfile.new
&gt;   t.to_i # =&gt; 6
&gt;   t.dup.to_i =&gt; 7

FinalizerManager will keep track of the open File objects for the
particular file and will only unlink the file when all of the File objects
have been closed.

https://github.com/ruby/tempfile/commit/753ab16642
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As @jeremyevans pointed out for commit eb2d8b1:

&gt; Each Tempfile instance has a separate File instance and file descriptor:
&gt;
&gt;   t = Tempfile.new
&gt;   t.to_i # =&gt; 6
&gt;   t.dup.to_i =&gt; 7

FinalizerManager will keep track of the open File objects for the
particular file and will only unlink the file when all of the File objects
have been closed.

https://github.com/ruby/tempfile/commit/753ab16642
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tempfile] typofix</title>
<updated>2024-07-08T06:18:57+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-07-08T06:18:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b903d9f09fa70509ba17828d8a5b9fa65d2c0c6d'/>
<id>b903d9f09fa70509ba17828d8a5b9fa65d2c0c6d</id>
<content type='text'>
https://github.com/ruby/tempfile/commit/82a74b017e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/tempfile/commit/82a74b017e
</pre>
</div>
</content>
</entry>
<entry>
<title>Tempfile.create(anonymous: true) implemented. (#10803)</title>
<updated>2024-06-01T06:11:19+00:00</updated>
<author>
<name>akr</name>
<email>akr@fsij.org</email>
</author>
<published>2024-06-01T06:11:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3ee83c73c38070d695537d4322ce4decb970a54a'/>
<id>3ee83c73c38070d695537d4322ce4decb970a54a</id>
<content type='text'>
The keyword argument `anonymous` is implemented for `Tempfile.create`

The default is `anonymous: false`.
The behavior is not changed as before.

The created temporary file is immediately removed if `anonymous: true` is specified.
So applications don't need to remove the file.
The actual storage of the file is reclaimed by the OS when the file is closed.

It uses `O_TMPFILE` for Linux 3.11 or later.
It creates an anonymous file from the beginning.

It uses FILE_SHARE_DELETE for Windows.
It makes it possible to remove the opened file.

[Feature #20497]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The keyword argument `anonymous` is implemented for `Tempfile.create`

The default is `anonymous: false`.
The behavior is not changed as before.

The created temporary file is immediately removed if `anonymous: true` is specified.
So applications don't need to remove the file.
The actual storage of the file is reclaimed by the OS when the file is closed.

It uses `O_TMPFILE` for Linux 3.11 or later.
It creates an anonymous file from the beginning.

It uses FILE_SHARE_DELETE for Windows.
It makes it possible to remove the opened file.

[Feature #20497]
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tempfile] Make Tempfile#open return the underlying File</title>
<updated>2023-11-08T16:47:29+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2023-11-08T16:35:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ddd99a529005eade4e99735e7aba8166f4a32ca2'/>
<id>ddd99a529005eade4e99735e7aba8166f4a32ca2</id>
<content type='text'>
Add test for this behavior.

https://github.com/ruby/tempfile/commit/0ca31a6b8d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add test for this behavior.

https://github.com/ruby/tempfile/commit/0ca31a6b8d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tempfile] Fix Tempfile#{dup,clone}</title>
<updated>2023-11-08T15:19:52+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2023-11-08T15:19:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ddcfc9feabf22ed6cc1071e65948a1d512a906fe'/>
<id>ddcfc9feabf22ed6cc1071e65948a1d512a906fe</id>
<content type='text'>
Instead of storing the delegate in @tmpfile, use __getobj__, since
delegate library already handles dup/clone for that.  Copy the
unlinked, mode, and opts instance variables to the returned object
when using dup/clone.

Split the close/unlink finalizer into two finalizers. The close
finalizer always closes when any Tempfile instance is GCed, since
each Tempfile instance uses a separate file descriptor. The unlink
finalizer unlinks only when the original and all duped/cloned
Tempfiles are GCed, since all share the same path.

For Tempfile#open, undefine the close finalizer after closing the
current file, the redefine the close finalizer with the new file.

Fixes [Bug #19441]

https://github.com/ruby/tempfile/commit/dafabf9c7b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of storing the delegate in @tmpfile, use __getobj__, since
delegate library already handles dup/clone for that.  Copy the
unlinked, mode, and opts instance variables to the returned object
when using dup/clone.

Split the close/unlink finalizer into two finalizers. The close
finalizer always closes when any Tempfile instance is GCed, since
each Tempfile instance uses a separate file descriptor. The unlink
finalizer unlinks only when the original and all duped/cloned
Tempfiles are GCed, since all share the same path.

For Tempfile#open, undefine the close finalizer after closing the
current file, the redefine the close finalizer with the new file.

Fixes [Bug #19441]

https://github.com/ruby/tempfile/commit/dafabf9c7b
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove --disable-gems in assert_in_out_err</title>
<updated>2023-08-28T19:05:19+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-08-26T23:31:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=91de37c23ec6b048e45df79cef1cb93a86316929'/>
<id>91de37c23ec6b048e45df79cef1cb93a86316929</id>
<content type='text'>
assert_in_out_err adds --disable=gems so we don't need to add
--disable-gems in the args list.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
assert_in_out_err adds --disable=gems so we don't need to add
--disable-gems in the args list.
</pre>
</div>
</content>
</entry>
<entry>
<title>Warn on access/modify of $SAFE, and remove effects of modifying $SAFE</title>
<updated>2019-11-17T23:00:25+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-09-21T02:06:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c5c05460ac20abcbc0ed686eb4acf06da7a39a79'/>
<id>c5c05460ac20abcbc0ed686eb4acf06da7a39a79</id>
<content type='text'>
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.

This modifies some internal functions that took a safe level argument
to no longer take the argument.

rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.

One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd.  We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.

This modifies some internal functions that took a safe level argument
to no longer take the argument.

rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.

One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd.  We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
</pre>
</div>
</content>
</entry>
</feed>
