summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--file.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/file.c b/file.c
index 3d8c800429..ff755b4ac3 100644
--- a/file.c
+++ b/file.c
@@ -5196,6 +5196,22 @@ rb_file_s_extname(VALUE klass, VALUE fname)
* File.path(File::NULL) #=> "/dev/null"
* File.path(Pathname.new("/tmp")) #=> "/tmp"
*
+ * If +path+ is not a String:
+ *
+ * 1. If it has the +to_path+ method, that method will be called to
+ * coerce to a String.
+ *
+ * 2. Otherwise, or if the coerced result is not a String too, the
+ * standard coersion using +to_str+ method will take place on that
+ * object. (See also String.try_convert)
+ *
+ * The coerced string must satisfy the following conditions:
+ *
+ * 1. It must be in an ASCII-compatible encoding; otherwise, an
+ * Encoding::CompatibilityError is raised.
+ *
+ * 2. It must not contain the NUL character (<tt>\0</tt>); otherwise,
+ * an ArgumentError is raised.
*/
static VALUE