Commit 7f9b9151 authored by Daniel Bovensiepen's avatar Daniel Bovensiepen

raise NoImplementedError also for sprintf in case it isn't available

parent e841135c
...@@ -50,7 +50,7 @@ module Kernel ...@@ -50,7 +50,7 @@ module Kernel
## ##
# Invoke method +sprintf+ and pass +*args+ to it. # Invoke method +sprintf+ and pass +*args+ to it.
# Pass return value to *print* of STDOUT. # Pass return value to +print+ of STDOUT.
def printf(*args) def printf(*args)
if Kernel.respond_to?(:sprintf) if Kernel.respond_to?(:sprintf)
__printstr__(sprintf(*args)) __printstr__(sprintf(*args))
...@@ -58,4 +58,14 @@ module Kernel ...@@ -58,4 +58,14 @@ module Kernel
raise NotImplementedError.new('sprintf not available') raise NotImplementedError.new('sprintf not available')
end end
end end
##
# +sprintf+ is defined in +src/sprintf.c+
# This stub method is only to inform the user
# that +sprintf+ isn't implemented.
unless Kernel.respond_to?(:sprintf)
def sprintf(*args)
raise NotImplementedError.new('sprintf not available')
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