Skip to content

Commit b0ae678

Browse files
committedNov 4, 2013
Cleanup io.rb
1 parent 69873e0 commit b0ae678

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed
 

‎corelib/io.rb

+13-9
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,36 @@ def readpartial(integer, outbuf = nil)
3838
end
3939
end
4040

41-
STDERR = $stderr = IO.new
42-
STDIN = $stdin = IO.new
43-
STDOUT = $stdout = IO.new
41+
STDERR = $stderr = IO.new
42+
STDIN = $stdin = IO.new
43+
STDOUT = $stdout = IO.new
4444

4545
def $stdout.puts(*strs)
4646
%x{
4747
for (var i = 0; i < strs.length; i++) {
48-
if(strs[i] instanceof Array) {
49-
#{ puts(*`strs[i]`) }
50-
} else {
48+
if (strs[i] instanceof Array) {
49+
#{puts(*`strs[i]`)};
50+
}
51+
else {
5152
console.log(#{`strs[i]`.to_s});
5253
}
5354
}
5455
}
56+
5557
nil
5658
end
5759

5860
def $stderr.puts(*strs)
5961
%x{
6062
for (var i = 0; i < strs.length; i++) {
61-
if(strs[i] instanceof Array) {
62-
#{ puts(*`strs[i]`) }
63-
} else {
63+
if (strs[i] instanceof Array) {
64+
#{puts(*`strs[i]`)};
65+
}
66+
else {
6467
console.warn(#{`strs[i]`.to_s});
6568
}
6669
}
6770
}
71+
6872
nil
6973
end

0 commit comments

Comments
 (0)
Please sign in to comment.