Make printf optional based on sprintf

This commit is contained in:
Daniel Bovensiepen
2012-06-21 15:44:27 +08:00
parent d105ea496f
commit 2436ee817a
+7 -2
View File
@@ -48,7 +48,12 @@ module Kernel
args[0]
end
def printf(*args)
__printstr__(sprintf(*args))
if Kernel.respond_to?(:sprintf)
##
# Invoke method +sprintf+ and pass +*args+ to it.
# Pass return value to *print* of STDOUT.
def printf(*args)
__printstr__(sprintf(*args))
end
end
end