mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Drop initialization dependency from mruby-print to mruby-sprintf
In the old implementation, `Kernel#printf` raise error if `mruby-sprintf` gem isn't specified before `mruby-print` gem. The new implementation eliminates this ordering issue. This way is the same as `Kernel#printf` and `IO#printf` in `mruby-io` gem.
This commit is contained in:
@@ -48,14 +48,8 @@ module Kernel
|
|||||||
args.__svalue
|
args.__svalue
|
||||||
end
|
end
|
||||||
|
|
||||||
unless Kernel.respond_to?(:sprintf)
|
def printf(*args)
|
||||||
def printf(*args)
|
__printstr__(sprintf(*args))
|
||||||
raise NotImplementedError.new('printf not available')
|
nil
|
||||||
end
|
|
||||||
else
|
|
||||||
def printf(*args)
|
|
||||||
__printstr__(sprintf(*args))
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user