From d86c4a795d44d5dbf12677ecf35f23abfa8ccdeb Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 24 Feb 2023 14:01:02 +0900 Subject: [PATCH] mruby-io does not provide `to_path` method for implicit conversion mruby does not use implicit type conversion by `to_xxx` (e.g. to_int, to_str, etc.) --- mrbgems/mruby-io/README.md | 2 +- mrbgems/mruby-io/mrblib/file.rb | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mrbgems/mruby-io/README.md b/mrbgems/mruby-io/README.md index 525785fa0..6e0a8cc84 100644 --- a/mrbgems/mruby-io/README.md +++ b/mrbgems/mruby-io/README.md @@ -165,7 +165,7 @@ Add the line below to your build configuration. | File#flock | o | | | File#lstat | | | | File#mtime | | | -| File#path, File#to_path | o | | +| File#path | o | | | File#size | | | | File#truncate | | | diff --git a/mrbgems/mruby-io/mrblib/file.rb b/mrbgems/mruby-io/mrblib/file.rb index 9398acef6..b706cf0de 100644 --- a/mrbgems/mruby-io/mrblib/file.rb +++ b/mrbgems/mruby-io/mrblib/file.rb @@ -199,8 +199,6 @@ class File < IO def self.path(filename) if filename.kind_of?(String) filename - elsif filename.respond_to?(:to_path) - filename.to_path else raise TypeError, "no implicit conversion of #{filename.class} into String" end