Commit 8dcf0bc2 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #306 from bovi/printf-optional

Make printf optional based on sprintf
parents 766ae4ee 2436ee81
...@@ -48,7 +48,12 @@ module Kernel ...@@ -48,7 +48,12 @@ module Kernel
args[0] args[0]
end end
def printf(*args) if Kernel.respond_to?(:sprintf)
__printstr__(sprintf(*args)) ##
# Invoke method +sprintf+ and pass +*args+ to it.
# Pass return value to *print* of STDOUT.
def printf(*args)
__printstr__(sprintf(*args))
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment