Skip to content

Commit 1fba56d

Browse files
author
macbookpr02010
committed
Add printf method to IRuby::OStream as required by the benchmark-ips gem
1 parent 5846f9c commit 1fba56d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/iruby/ostream.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def write(s)
3333
alias_method :<<, :write
3434
alias_method :print, :write
3535

36+
def printf(*fmt)
37+
write sprintf(*fmt)
38+
end
39+
3640
def puts(*lines)
3741
lines = [''] if lines.empty?
3842
lines.each { |s| write("#{s}\n")}

0 commit comments

Comments
 (0)