Issue #15411 has been reported by zverok (Victor Shepelev).

----------------------------------------
Bug #15411: Enhance Tempfile docs
https://bugs.ruby-lang.org/issues/15411

* Author: zverok (Victor Shepelev)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Several small style enhancements + I don't know why the "fake" docs for `::new` were done this way, but they hid the `mode:` keyword argument, which once cost me several dozens of minutes to investigate. 

Docs [currently](https://ruby-doc.org/stdlib-2.5.0/libdoc/tempfile/rdoc/Tempfile.html#method-c-new) insist on this call-sequence:
```
new(basename = "", [tmpdir = Dir.tmpdir], [options])
```
...insisiting that it will pass **all** the options to `File.new`. So, when I wanted to pass `mode` for File, and ... well, it haven't ended well :)

So, I believe that it is better to represent actual call-sequence in the docs, and mention `mode` quirks.

---Files--------------------------------
tempfile-docs.patch (2.71 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>