< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #16688 has been updated by Dan0042 (Daniel DeLorme).
* [Feature #16688] Allow #to_path object as argument to system() (dan0042)
* system/exec should be compatible with Pathname objects
----------------------------------------
Feature #16688: Allow #to_path object as argument to system()
https://bugs.ruby-lang.org/issues/16688#change-84911
* Author: Dan0042 (Daniel DeLorme)
* Status: Open
* Priority: Normal
----------------------------------------
I often work with Pathname objects, but when passing them to a system command I find it a bit tedious that they have to be explicitly converted to a String.
```ruby
file = BASE + "config.json"
system(@cmd, file) #=> TypeError (no implicit conversion of Pathname into String)
system(@cmd, file.to_s) #=> works
```
I propose that the system/exec/spawn family of methods should try to convert their arguments using `to_path`, if `to_str` fails. I believe it makes perfect sense, since commandline arguments are so often pathnames.
This includes in/out redirection. `system("ls", out: Pathname.new("file"))` should be valid.
--
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>