Skip to content
Permalink
Browse files
[Truffle] Pulled in Kernel#warn from Rubinius.
  • Loading branch information
nirvdrum committed Feb 19, 2015
1 parent c3a7c5a commit 8324dc47fd109a8a0b6c340b67c8fe6a02002979
Showing 3 changed files with 8 additions and 5 deletions.
@@ -1,9 +1,5 @@
fails:Kernel#warn is a private method
fails:Kernel#warn requires multiple arguments
fails:Kernel#warn does not append line-end if last character is line-end
fails:Kernel#warn calls #write on $stderr if $VERBOSE is true
fails:Kernel#warn calls #write on $stderr if $VERBOSE is false
fails:Kernel#warn does not call #write on $stderr if $VERBOSE is nil
fails:Kernel#warn writes each argument on a line when passed multiple arguments
fails:Kernel#warn does not write strings when passed no arguments
fails:Kernel#warn writes the default record separator and NOT $/ to $stderr after the warning message
@@ -128,4 +128,10 @@ def trap(sig, prc=nil, &block)
end
module_function :trap

def warn(*messages)
$stderr.puts(*messages) if !$VERBOSE.nil? && !messages.empty?
nil
end
module_function :warn

end
@@ -65,9 +65,10 @@ def sync=(value)
end

STDERR = IO.new
$stderr = STDERR

class << STDERR
def self.puts(*values)
def puts(*values)
Kernel.send(:puts, *values)
end
end

0 comments on commit 8324dc4

Please sign in to comment.