Skip to content

Commit

Permalink
mruby-io does not provide to_path method for implicit conversion
Browse files Browse the repository at this point in the history
mruby does not use implicit type conversion by `to_xxx` (e.g. to_int,
to_str, etc.)
  • Loading branch information
matz committed Mar 3, 2023
1 parent d7f4af0 commit d86c4a7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion mrbgems/mruby-io/README.md
Expand Up @@ -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 | | |

Expand Down
2 changes: 0 additions & 2 deletions mrbgems/mruby-io/mrblib/file.rb
Expand Up @@ -199,8 +199,6 @@ def self.extname(filename)
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
Expand Down

0 comments on commit d86c4a7

Please sign in to comment.