class IRB::OutputMethod
or Context.new
IRB::Notifier. You can define your own output method to use with Irb.new,
An abstract output class for IO in irb. This is mainly used internally by
def parse_printf_format(format, opts)
#
%
+format+ from #printf
Kernel#sprintf, if there was a successful Regexp match in the given
Returns an array of the given +format+ and +opts+ to be used by
def parse_printf_format(format, opts) return format, opts if $1.size % 2 == 1 end
def pp(*objs)
Prints the given +objs+ calling Object#inspect on each.
def pp(*objs) puts(*objs.collect{|obj| obj.inspect}) end
def ppx(prefix, *objs)
given +prefix+.
Prints the given +objs+ calling Object#inspect on each and appending the
def ppx(prefix, *objs) puts(*objs.collect{|obj| prefix+obj.inspect}) end
def print(*opts)
Open this method to implement your own output method, raises a
def print(*opts) raise NotImplementedError, "print" end
def printf(format, *opts)
Extends IO#printf to format the given +opts+ for Kernel#sprintf using
def printf(format, *opts) if /(%*)%I/ =~ format format, opts = parse_printf_format(format, opts) end print sprintf(format, *opts) end
def printn(*opts)
def printn(*opts) print opts.join(" "), "\n" end
def puts(*objs)
Calls #print on each element in the given +objs+, followed by a newline
def puts(*objs) for obj in objs print(*obj) print "\n" end end