[ruby-core:90525] [Ruby trunk Bug#15411] Enhance Tempfile docs

From: zverok.offline@...
Date: 2018-12-13 22:46:38 UTC
List: ruby-core #90525
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:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next