diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-04-30 23:47:47 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-05-01 00:00:14 +0900 |
| commit | 8f362eaf8a49af23c2c68d7d84b24c5211578881 (patch) | |
| tree | 35ec754e7b9cadb1889c315352aaf351b75ffe4c /mrbgems/mruby-io | |
| parent | 519dc3d19c355e53f3fa539da1696b6f4c40d87d (diff) | |
| download | mruby-8f362eaf8a49af23c2c68d7d84b24c5211578881.tar.gz mruby-8f362eaf8a49af23c2c68d7d84b24c5211578881.zip | |
io.rb,print.rb: `puts` to expand array arguments.
As CRuby behaves.
Diffstat (limited to 'mrbgems/mruby-io')
| -rw-r--r-- | mrbgems/mruby-io/mrblib/io.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mrbgems/mruby-io/mrblib/io.rb b/mrbgems/mruby-io/mrblib/io.rb index 8f81c5f3a..645733226 100644 --- a/mrbgems/mruby-io/mrblib/io.rb +++ b/mrbgems/mruby-io/mrblib/io.rb @@ -360,9 +360,14 @@ class IO i = 0 len = args.size while i < len - s = args[i].to_s - write s - write "\n" if (s[-1] != "\n") + s = args[i] + if s.kind_of?(Array) + puts(*s) + else + s = s.to_s + write s + write "\n" if (s[-1] != "\n") + end i += 1 end write "\n" if len == 0 |
