Convert to string before output in puts

For example, evaluating `puts nil` raised `NoMethodError` before.
This commit is contained in:
dearblue
2023-08-28 21:41:03 +09:00
parent 1e385692d1
commit 301bcc636e
+1
View File
@@ -28,6 +28,7 @@ module Kernel
if s.kind_of?(Array)
puts(*s)
else
s = s.to_s
print s
print "\n" if (s[-1] != "\n")
end