mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[ruby/tempfile] Stop using IO::NULL for feature detection
`IO::NULL`'s underlying file `/dev/null` is not always available on WASI, so use of the file on top-level code (introduced in https://github.com/ruby/tempfile/pull/36) causes tempfile library not to work at all on WASI. https://github.com/ruby/tempfile/commit/d50939890e
This commit is contained in:
parent
62007415c4
commit
6c142d05fa
@ -593,9 +593,7 @@ private def create_with_filename(basename="", tmpdir=nil, mode: 0, **options)
|
||||
end
|
||||
end
|
||||
|
||||
File.open(IO::NULL) do |f|
|
||||
File.new(f.fileno, autoclose: false, path: "").path
|
||||
rescue IOError
|
||||
if RUBY_VERSION < "3.2"
|
||||
module PathAttr # :nodoc:
|
||||
attr_reader :path
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user