Skip to content

Commit

Permalink
Cleanup io.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Nov 4, 2013
1 parent 69873e0 commit b0ae678
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions corelib/io.rb
Expand Up @@ -38,32 +38,36 @@ def readpartial(integer, outbuf = nil)
end
end

STDERR = $stderr = IO.new
STDIN = $stdin = IO.new
STDOUT = $stdout = IO.new
STDERR = $stderr = IO.new
STDIN = $stdin = IO.new
STDOUT = $stdout = IO.new

def $stdout.puts(*strs)
%x{
for (var i = 0; i < strs.length; i++) {
if(strs[i] instanceof Array) {
#{ puts(*`strs[i]`) }
} else {
if (strs[i] instanceof Array) {
#{puts(*`strs[i]`)};
}
else {
console.log(#{`strs[i]`.to_s});
}
}
}

nil
end

def $stderr.puts(*strs)
%x{
for (var i = 0; i < strs.length; i++) {
if(strs[i] instanceof Array) {
#{ puts(*`strs[i]`) }
} else {
if (strs[i] instanceof Array) {
#{puts(*`strs[i]`)};
}
else {
console.warn(#{`strs[i]`.to_s});
}
}
}

nil
end

0 comments on commit b0ae678

Please sign in to comment.