2 # output-method.rb - optput methods used by irb
3 # $Release Version: 0.9.5$
5 # by Keiju ISHITSUKA(keiju@ruby-lang.org)
22 IRB.fail NotImplementError, "print"
26 print opts.join(" "), "\n"
30 def printf(format, *opts)
32 format, opts = parse_printf_format(format, opts)
34 print sprintf(format, *opts)
39 # <minimum field width> (\*|\*[1-9][0-9]*\$|[1-9][0-9]*)
40 # <precision>.(\*|\*[1-9][0-9]*\$|[1-9][0-9]*|)?
41 # #<length modifier>(hh|h|l|ll|L|q|j|z|t)
42 # <conversion specifier>[diouxXeEfgGcsb%]
43 def parse_printf_format(format, opts)
44 return format, opts if $1.size % 2 == 1
55 puts(*objs.collect{|obj| obj.inspect})
58 def ppx(prefix, *objs)
59 puts(*objs.collect{|obj| prefix+obj.inspect})
64 class StdioOutputMethod<OutputMethod