Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Ruby Programming
Previous Page Home Next Page

Commands

At the irb prompt, you can enter any valid Ruby expression and see the results. You can also use any of the following commands to control the irb session.

exit, quit, irb_exit
Quits this irb session or subsession. If you've used cb to change bindings (see below), exits from this binding mode.

conf, irb_context
Displays current configuration. Modifying the configuration is achieved by invoking methods of conf.

conf.back_trace_limit n
Sets display lines of backtrace as top n and tail n. The default value is 16.

conf.debug_level = N
Sets debug level of irb.

conf.ignore_eof = true/false
Specifies the behavior of an end of file received on input. If true, it will be ignored; otherwise, it will quit irb.

conf.ignore_sigint= true/false
Specifies the behavior of ^C (control-c). If false, ^C will quit irb. If true, ^C during input will cancel input and return to the top level; during execution, ^C will abort the current operation.

conf.inf_ruby_mode = true/false
If true, changes the prompt and disables readline support, allowing irb to work with inf-ruby-mode. [inf-ruby-mode allows Emacs users to interact with Ruby while editing programs. See the file inf_ruby.el in the misc directory of the distribution for more details.] The default value is false.

conf.inspect_mode = true/false/nil
Specifies inspect mode according to the following values:

true Display inspect (default).
false Display to_s.
nil Inspect mode in non-math mode, non-inspect mode in math mode.

conf.irb_level
Displays the current binding level (see cb).

conf.math_mode
Displays whether or not Ruby is in math mode.

conf.use_loader = true/false
Specifies whether or not irb's own file reader method is used with load/require.

conf.prompt_c
The prompt for a continuing statement (for example, immediately after an ``if'').

conf.prompt_i
The standard, top-level prompt.

conf.prompt_s
The prompt for a continuing string.

conf.rc = true/false
Specifies whether or not to use the initialization file ~/.irbrc.

conf.use_prompt = true/false
Specifies whether or not to display prompts.

conf.use_readline = true/false/nil
Specifies whether or not to use Readline according to the following values:

true Use Readline.
false Do not use Readline.
nil Use Readline except for inf-ruby-mode (default).

conf.verbose=true/false
Specifies whether or not verbose messages are displayed.

cb, irb_change_binding [ obj ]
Creates and enters a new binding that has its own scope for local variables. If obj is given, it will be used as self in the new binding.

irb [obj]
Starts an irb subsession. If obj is given, it will be used as self.

jobs, irb_jobs
Lists irb subsessions.

fg n, irb_fg n
Switches into the specified irb subsession. n may be any of the following values:

irb subsession number
thread id
irb object
self (the obj that launched a particular subsession)

kill n, irb_kill n
Kills an irb subsession. n may be any of the values as described for irb_fg.

Ruby Programming
Previous Page Home Next Page

 
 
  Published under the terms of the Open Publication License Design by Interspire