2008-10-25 20:44:13 +04:00
|
|
|
.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
|
|
|
|
.Dd October 25, 2008
|
|
|
|
.Dt IRB(1) "" "Ruby Programmers Reference Guide"
|
|
|
|
.Os UNIX
|
|
|
|
.Sh NAME
|
|
|
|
.Nm irb
|
|
|
|
.Nd Interactive Ruby Shell
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Fl -version
|
2008-12-27 07:12:38 +03:00
|
|
|
.Op Fl dfm
|
|
|
|
.Op Fl I Ar directory
|
|
|
|
.Op Fl r Ar library
|
2008-10-25 20:44:13 +04:00
|
|
|
.Op Fl - Ns Oo no Oc Ns inspect
|
|
|
|
.Op Fl - Ns Oo no Oc Ns readline
|
|
|
|
.Op Fl -prompt Ar mode
|
|
|
|
.Op Fl -prompt-mode Ar mode
|
|
|
|
.Op Fl -inf-ruby-mode
|
|
|
|
.Op Fl -simple-prompt
|
|
|
|
.Op Fl -noprompt
|
|
|
|
.Op Fl -tracer
|
|
|
|
.Op Fl -back-trace-limit Ar n
|
|
|
|
.Op Fl -irb_debug Ar n
|
|
|
|
.Op Fl -
|
|
|
|
.Op program_file
|
|
|
|
.Op argument ...
|
|
|
|
.Pp
|
|
|
|
.Sh DESCRIPTION
|
2008-12-27 07:12:38 +03:00
|
|
|
.Nm
|
|
|
|
is the REPL(read-eval&print loop) environment for Ruby programs.
|
2008-10-25 20:44:13 +04:00
|
|
|
.Pp
|
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width "1234567890123" -compact
|
|
|
|
.Pp
|
2008-12-27 07:12:38 +03:00
|
|
|
.It Fl -version
|
|
|
|
Prints the version of
|
|
|
|
.Nm .
|
|
|
|
.Pp
|
|
|
|
.It Fl E Ar external Ns Op : Ns Ar internal
|
|
|
|
.It Fl -encoding Ar external Ns Op : Ns Ar internal
|
|
|
|
Same as `ruby -E' .
|
|
|
|
Specifies the default value(s) for external encodings and internal encoding. Values should be separated with colon (:).
|
2009-10-26 09:44:31 +03:00
|
|
|
.Pp
|
2008-12-27 07:12:38 +03:00
|
|
|
You can ommit the one for internal encodings, then the value
|
|
|
|
.Pf ( Li "Encoding.default_internal" ) will be nil.
|
|
|
|
.Pp
|
|
|
|
.It Fl I Ar path
|
|
|
|
Same as `ruby -I' .
|
|
|
|
Specifies
|
|
|
|
.Li $LOAD_PATH
|
|
|
|
directory
|
|
|
|
.Pp
|
|
|
|
.It Fl U
|
|
|
|
Same as `ruby -U' .
|
|
|
|
Sets the defalut value for internal encodings
|
|
|
|
.Pf ( Li "Encoding.default_internal" ) to UTF-8.
|
|
|
|
.Pp
|
2008-10-25 20:44:13 +04:00
|
|
|
.It Fl d
|
2008-12-27 07:12:38 +03:00
|
|
|
Same as `ruby -d' .
|
2008-10-25 20:44:13 +04:00
|
|
|
Sets
|
|
|
|
.Li $DEBUG
|
2008-12-27 07:12:38 +03:00
|
|
|
to true.
|
2008-10-25 20:44:13 +04:00
|
|
|
.Pp
|
|
|
|
.It Fl f
|
2009-10-26 09:44:31 +03:00
|
|
|
Suppresses read of
|
2008-12-27 07:12:38 +03:00
|
|
|
.Pa ~/.irbrc .
|
|
|
|
.Pp
|
|
|
|
.It Fl h
|
|
|
|
.It Fl -help
|
|
|
|
Prints a summary of the options.
|
2008-10-25 20:44:13 +04:00
|
|
|
.Pp
|
|
|
|
.It Fl m
|
|
|
|
Bc mode (load mathn, fraction or matrix are available)
|
|
|
|
.Pp
|
2008-12-27 07:12:38 +03:00
|
|
|
.It Fl r Ar library
|
|
|
|
Same as `ruby -r'.
|
|
|
|
Causes irb to load the library using require.
|
2008-10-25 20:44:13 +04:00
|
|
|
.Pp
|
|
|
|
.It Fl -inspect
|
|
|
|
Uses `inspect' for output (default except for bc mode)
|
|
|
|
.Pp
|
|
|
|
.It Fl -noinspect
|
|
|
|
Doesn't use inspect for output
|
|
|
|
.Pp
|
|
|
|
.It Fl -readline
|
|
|
|
Uses Readline extension module.
|
|
|
|
.Pp
|
|
|
|
.It Fl -noreadline
|
|
|
|
Doesn't use Readline extension module.
|
|
|
|
.Pp
|
|
|
|
.It Fl -prompt Ar mode
|
|
|
|
.It Fl -prompt-mode Ar mode
|
|
|
|
Switch prompt mode. Pre-defined prompt modes are
|
|
|
|
`default', `simple', `xmp' and `inf-ruby'.
|
|
|
|
.Pp
|
2009-10-26 09:44:31 +03:00
|
|
|
.It Fl -inf-ruby-mode
|
|
|
|
Uses prompt appropriate for inf-ruby-mode on emacs.
|
|
|
|
Suppresses --readline.
|
2008-10-25 20:44:13 +04:00
|
|
|
.Pp
|
|
|
|
.It Fl -simple-prompt
|
|
|
|
Makes prompts simple.
|
|
|
|
.Pp
|
|
|
|
.It Fl -noprompt
|
|
|
|
No prompt mode.
|
|
|
|
.Pp
|
|
|
|
.It Fl -tracer
|
|
|
|
Displays trace for each execution of commands.
|
|
|
|
.Pp
|
|
|
|
.It Fl -back-trace-limit Ar n
|
|
|
|
Displays backtrace top
|
|
|
|
.Ar n
|
|
|
|
and tail
|
|
|
|
.Ar n Ns .
|
2009-10-26 09:44:31 +03:00
|
|
|
The default value is 16.
|
2008-10-25 20:44:13 +04:00
|
|
|
.Pp
|
|
|
|
.It Fl -irb_debug Ar n
|
|
|
|
Sets internal debug level to n (not for popular use)
|
|
|
|
.Pp
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
.Sh ENVIRONMENT
|
|
|
|
.Bl -tag -width "RUBYLIB_PREFIX" -compact
|
|
|
|
.It Ev IRBRC
|
|
|
|
.Pp
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Also
|
|
|
|
.Nm
|
|
|
|
depends on same variables as
|
|
|
|
.Xr ruby 1 .
|
|
|
|
.Pp
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width "RUBYLIB_PREFIX" -compact
|
|
|
|
.It Pa ~/.irbrc
|
|
|
|
Personal irb initialization.
|
|
|
|
.Pp
|
|
|
|
.El
|
|
|
|
.Pp
|
2008-11-29 18:00:48 +03:00
|
|
|
.Sh EXAMPLES
|
|
|
|
.Dl % irb
|
|
|
|
.Dl irb(main):001:0> Ic 1 + 1
|
|
|
|
.Dl 2
|
|
|
|
.Dl irb(main):002:0> Ic def t(x)
|
|
|
|
.Dl irb(main):003:1> Ic x+1
|
|
|
|
.Dl irb(main):004:1> Ic end
|
|
|
|
.Dl => nil
|
|
|
|
.Dl irb(main):005:0> Ic t(3)
|
|
|
|
.Dl => 4
|
|
|
|
.Dl irb(main):006:0> Ic if t(3) == 4
|
|
|
|
.Dl irb(main):007:1> Ic p :ok
|
|
|
|
.Dl irb(main):008:1> Ic end
|
|
|
|
.Dl :ok
|
|
|
|
.Dl => :ok
|
|
|
|
.Dl irb(main):009:0> Ic quit
|
2009-10-26 09:44:31 +03:00
|
|
|
.Dl %
|
2008-11-29 18:00:48 +03:00
|
|
|
.Pp
|
2008-10-25 20:44:13 +04:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ruby 1 .
|
|
|
|
.Pp
|
|
|
|
.Sh REPORTING BUGS
|
|
|
|
.Bl -bullet
|
2009-10-26 09:44:31 +03:00
|
|
|
.Li Security vulnerabilities should be reported via an email to
|
2008-10-25 20:44:13 +04:00
|
|
|
.Aq security@ruby-lang.org Ns
|
|
|
|
.Li .
|
|
|
|
Reported problems will be published after fixed.
|
|
|
|
.Pp
|
|
|
|
.Li And you can report other bugs and feature requests via the
|
|
|
|
Ruby Issue Tracking System (http://redmine.ruby-lang.org).
|
|
|
|
Do not report security vulnerabilities
|
|
|
|
via the system because it publishes the vulnerabilities immedately.
|
|
|
|
.El
|
|
|
|
.Sh AUTHORS
|
|
|
|
Written by Keiju ISHITSUKA.
|