mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
raise NotImplementedError in case of sprintf is missing
This commit is contained in:
+7
-5
@@ -48,12 +48,14 @@ module Kernel
|
||||
args[0]
|
||||
end
|
||||
|
||||
if Kernel.respond_to?(:sprintf)
|
||||
##
|
||||
# Invoke method +sprintf+ and pass +*args+ to it.
|
||||
# Pass return value to *print* of STDOUT.
|
||||
def printf(*args)
|
||||
##
|
||||
# Invoke method +sprintf+ and pass +*args+ to it.
|
||||
# Pass return value to *print* of STDOUT.
|
||||
def printf(*args)
|
||||
if Kernel.respond_to?(:sprintf)
|
||||
__printstr__(sprintf(*args))
|
||||
else
|
||||
raise NotImplementedError.new('sprintf not available')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user