[#97536] [Ruby master Bug#16694] JIT vs hardened GCC with PCH — v.ondruch@...
Issue #16694 has been reported by vo.x (Vit Ondruch).
11 messages
2020/03/18
[ruby-core:97451] [Ruby master Feature#16688] Allow #to_path object as argument to system()
From:
zverok.offline@...
Date:
2020-03-11 17:01:14 UTC
List:
ruby-core #97451
Issue #16688 has been updated by zverok (Victor Shepelev). I always wondered, why `Pathname` doesn't define `to_str`?.. It seems to be a perfectly suitable option: implicit conversion for "specialized" variety of the `String`, and it will make _all_ non-Pathname-aware code work as expected... What are the downsides? ---------------------------------------- Feature #16688: Allow #to_path object as argument to system() https://bugs.ruby-lang.org/issues/16688#change-84595 * 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. -- 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>