| | | |
Offset 1, 250 lines modified | Offset 1, 313 lines modified |
1 | .\"Ruby·is·copyrighted·by·Yukihiro·Matsumoto·<matz@netlab.jp>. | |
2 | .Dd·August·11,·2019 | |
3 | .Dt·IRB·\&1·"Ruby·Programmer's·Reference·Guide" | 1 | .TH·IRB·\&1·"Ruby·Programmer's·Reference·Guide"·"August·11,·2019"·"UNIX" |
4 | .Os·UNIX | |
5 | .Sh·NAME | 2 | .SH·NAME |
6 | .Nm·irb | 3 | \fBirb\fP |
7 | .Nd·Interactive·Ruby·Shell | 4 | \-·Interactive·Ruby·Shell |
8 | .Sh·SYNOPSIS | 5 | .SH·SYNOPSIS |
9 | .Nm | |
10 | .Op·Fl·-version | |
11 | .Op·Fl·dfUw | |
12 | .Op·Fl·I·Ar·directory | |
13 | .Op·Fl·r·Ar·library | |
14 | .Op·Fl·E·Ar·external·Ns·Op·:·Ns·Ar·internal | |
15 | .Op·Fl·W·Ns·Op·Ar·level | |
16 | .Op·Fl·-·Ns·Oo·no·Oc·Ns·inspect | |
17 | .Op·Fl·-·Ns·Oo·no·Oc·Ns·multiline | |
18 | .Op·Fl·-·Ns·Oo·no·Oc·Ns·singleline | |
19 | .Op·Fl·-·Ns·Oo·no·Oc·Ns·echo | |
20 | .Op·Fl·-·Ns·Oo·no·Oc·Ns·colorize | |
21 | .Op·Fl·-·Ns·Oo·no·Oc·Ns·autocomplete | |
22 | .Op·Fl·-·Ns·Oo·no·Oc·Ns·verbose | |
23 | .Op·Fl·-prompt·Ar·mode | |
24 | .Op·Fl·-prompt-mode·Ar·mode | |
25 | .Op·Fl·-inf-ruby-mode | |
26 | .Op·Fl·-simple-prompt | |
27 | .Op·Fl·-noprompt | |
28 | .Op·Fl·-tracer | |
29 | .Op·Fl·-back-trace-limit·Ar·n | |
30 | .Op·Fl·- | 6 | .br |
| 7 | \fBirb\fP |
| 8 | [\fB\--version\fP] |
| 9 | [\fB\-dfUw\fP] |
| 10 | [\fB\-I\fP·\fIdirectory\fP] |
| 11 | [\fB\-r\fP·\fIlibrary\fP] |
| 12 | [\fB\-E\fP·\fIexternal\fP[:\fIinternal\fP]] |
| 13 | [\fB\-W\fP[\fIlevel\fP]] |
| 14 | [\fB\--\fP[no]inspect] |
| 15 | [\fB\--\fP[no]multiline] |
| 16 | [\fB\--\fP[no]singleline] |
| 17 | [\fB\--\fP[no]echo] |
| 18 | [\fB\--\fP[no]colorize] |
| 19 | [\fB\--\fP[no]autocomplete] |
| 20 | [\fB\--\fP[no]verbose] |
| 21 | [\fB\--prompt\fP·\fImode\fP] |
| 22 | [\fB\--prompt-mode\fP·\fImode\fP] |
| 23 | [\fB\--inf-ruby-mode\fP] |
| 24 | [\fB\--simple-prompt\fP] |
| 25 | [\fB\--noprompt\fP] |
| 26 | [\fB\--tracer\fP] |
| 27 | [\fB\--back-trace-limit\fP·\fIn\fP] |
| 28 | [\fB\--\fP] |
31 | .Op·program_file | 29 | [program_file] |
32 | .Op·argument·... | 30 | [argument·...] |
33 | .Pp | |
34 | .Sh·DESCRIPTION | 31 | .SH·DESCRIPTION |
35 | .Nm | 32 | \fBirb\fP |
36 | is·the·REPL(read-eval-print·loop)·environment·for·Ruby·programs. | 33 | is·the·REPL(read-eval-print·loop)·environment·for·Ruby·programs. |
37 | .Pp | |
38 | .Sh·OPTIONS | 34 | .SH·OPTIONS |
39 | .Bl·-tag·-width·"1234567890123"·-compact | |
40 | .Pp | |
41 | .It·Fl·-version | |
| 35 | .TP |
| 36 | \fB\--version\fP |
42 | Prints·the·version·of | 37 | Prints·the·version·of |
43 | .Nm·. | |
44 | .Pp | |
45 | .It·Fl·E·Ar·external·Ns·Op·:·Ns·Ar·internal | |
46 | .It·Fl·-encoding·Ar·external·Ns·Op·:·Ns·Ar·internal | 38 | \fB.\fP |
| |
| 39 | .TP |
| 40 | \fB\-E\fP·\fIexternal\fP[:\fIinternal\fP] |
| 41 | .TP |
| 42 | \fB\--encoding\fP·\fIexternal\fP[:\fIinternal\fP] |
47 | Same·as·`ruby·-E'·. | 43 | Same·as·`ruby·-E'·. |
48 | Specifies·the·default·value(s)·for·external·encodings·and·internal·encoding.·Values·should·be·separated·with·colon·(:). | 44 | Specifies·the·default·value(s)·for·external·encodings·and·internal·encoding.·Values·should·be·separated·with·colon·(:). |
49 | .Pp | |
50 | You·can·omit·the·one·for·internal·encodings,·then·the·value | 45 | You·can·omit·the·one·for·internal·encodings,·then·the·value |
51 | .Pf·(·Li·"Encoding.default_internal"·)·will·be·nil. | 46 | ("Encoding.default_internal")·will·be·nil. |
52 | .Pp | |
53 | .It·Fl·I·Ar·path | |
| 47 | .TP |
| 48 | \fB\-I\fP·\fIpath\fP |
54 | Same·as·`ruby·-I'·. | 49 | Same·as·`ruby·-I'·. |
55 | Specifies | 50 | Specifies |
56 | .Li·$LOAD_PATH | 51 | $LOAD_PATH |
57 | directory | 52 | directory |
58 | .Pp | |
59 | .It·Fl·U | |
| 53 | .TP |
| 54 | \fB\-U\fP |
60 | Same·as·`ruby·-U'·. | 55 | Same·as·`ruby·-U'·. |
61 | Sets·the·default·value·for·internal·encodings | 56 | Sets·the·default·value·for·internal·encodings |
62 | .Pf·(·Li·"Encoding.default_internal"·)·to·UTF-8. | 57 | ("Encoding.default_internal")·to·UTF-8. |
63 | .Pp | |
64 | .It·Fl·d | |
| 58 | .TP |
| 59 | \fB\-d\fP |
65 | Same·as·`ruby·-d'·. | 60 | Same·as·`ruby·-d'·. |
66 | Sets | 61 | Sets |
67 | .Li·$DEBUG | 62 | $DEBUG |
68 | to·true. | 63 | to·true. |
69 | .Pp | |
70 | .It·Fl·f | |
| 64 | .TP |
| 65 | \fB\-f\fP |
71 | Suppresses·read·of | 66 | Suppresses·read·of |
72 | .Pa·~/.irbrc·. | |
73 | .Pp | |
74 | .It·Fl·w | 67 | \fI~/.irbrc\fP. |
| |
| 68 | .TP |
| 69 | \fB\-w\fP |
75 | Same·as·`ruby·-w'·. | 70 | Same·as·`ruby·-w'·. |
76 | .Pp | |
77 | .Pp | |
78 | .It·Fl·W | |
| |
| 71 | .TP |
| 72 | \fB\-W\fP |
79 | Same·as·`ruby·-W'·. | 73 | Same·as·`ruby·-W'·. |
80 | .Pp | |
81 | .It·Fl·h | |
82 | .It·Fl·-help | |
| 74 | .TP |
| 75 | \fB\-h\fP |
| 76 | .TP |
| 77 | \fB\--help\fP |
83 | Prints·a·summary·of·the·options. | 78 | Prints·a·summary·of·the·options. |
84 | .Pp | |
85 | .It·Fl·r·Ar·library | |
| 79 | .TP |
| 80 | \fB\-r\fP·\fIlibrary\fP |
86 | Same·as·`ruby·-r'. | 81 | Same·as·`ruby·-r'. |
87 | Causes·irb·to·load·the·library·using·require. | 82 | Causes·irb·to·load·the·library·using·require. |
88 | .Pp | |
89 | .It·Fl·-inspect | |
| 83 | .TP |
| 84 | \fB\--inspect\fP |
90 | Uses·`inspect'·for·output·(default·except·for·bc·mode) | 85 | Uses·`inspect'·for·output·(default·except·for·bc·mode) |
91 | .Pp | |
92 | .It·Fl·-noinspect | |
| 86 | .TP |
| 87 | \fB\--noinspect\fP |
93 | Doesn't·use·inspect·for·output | 88 | Doesn't·use·inspect·for·output |
94 | .Pp | |
95 | .It·Fl·-multiline | |
| 89 | .TP |
| 90 | \fB\--multiline\fP |
96 | Uses·multiline·editor·module. | 91 | Uses·multiline·editor·module. |
97 | .Pp | |
98 | .It·Fl·-nomultiline | |
| 92 | .TP |
| 93 | \fB\--nomultiline\fP |
99 | Doesn't·use·multiline·editor·module. | 94 | Doesn't·use·multiline·editor·module. |
100 | .Pp | |
101 | .It·Fl·-singleline | |
| 95 | .TP |
| 96 | \fB\--singleline\fP |
102 | Uses·singleline·editor·module. | 97 | Uses·singleline·editor·module. |
103 | .Pp | |
104 | .It·Fl·-nosingleline | |
| 98 | .TP |
| 99 | \fB\--nosingleline\fP |
105 | Doesn't·use·singleline·editor·module. | 100 | Doesn't·use·singleline·editor·module. |
106 | .Pp | |
107 | .Pp | |
108 | .It·Fl·-extra-doc-dir | |
| |
| 101 | .TP |
| 102 | \fB\--extra-doc-dir\fP |
109 | Add·an·extra·doc·dir·for·the·doc·dialog. | 103 | Add·an·extra·doc·dir·for·the·doc·dialog. |
110 | .Pp | |
111 | .Pp | |
112 | .It·Fl·-echo | |
| |
| 104 | .TP |
| 105 | \fB\--echo\fP |
113 | Show·result·(default). | 106 | Show·result·(default). |
114 | .Pp | |
115 | .It·Fl·-noecho | |
| 107 | .TP |
| 108 | \fB\--noecho\fP |
116 | Don't·show·result. | 109 | Don't·show·result. |
117 | .Pp | |
118 | .Pp | |
119 | .It·Fl·-echo-on-assignment | |
| |
| 110 | .TP |
| 111 | \fB\--echo-on-assignment\fP |
120 | Show·result·on·assignment. | 112 | Show·result·on·assignment. |
121 | .Pp | |
122 | .It·Fl·-noecho-on-assignment | |
| 113 | .TP |
| 114 | \fB\--noecho-on-assignment\fP |
123 | Don't·show·result·on·assignment. | 115 | Don't·show·result·on·assignment. |
124 | .Pp | |
| 116 | .TP |
125 | .It·Fl·-truncate-echo-on-assignment | 117 | \fB\--truncate-echo-on-assignment\fP |
126 | Show·truncated·result·on·assignment·(default). | 118 | Show·truncated·result·on·assignment·(default). |
127 | .Pp | |
128 | .Pp | |
129 | .It·Fl·-colorize | |
| |
| 119 | .TP |
| 120 | \fB\--colorize\fP |
130 | Use·colorization. | 121 | Use·colorization. |
131 | .Pp | |
132 | .It·Fl·-nocolorize | |
| 122 | .TP |
| 123 | \fB\--nocolorize\fP |
133 | Don't·use·colorization. | 124 | Don't·use·colorization. |
134 | .Pp | |
135 | .Pp | |
136 | .It·Fl·-autocomplete | |
| |
| 125 | .TP |
| 126 | \fB\--autocomplete\fP |
137 | Use·autocompletion. | 127 | Use·autocompletion. |
138 | .Pp | |
139 | .It·Fl·-noautocomplete | |
| 128 | .TP |
| 129 | \fB\--noautocomplete\fP |
140 | Don't·use·autocompletion. | 130 | Don't·use·autocompletion. |
141 | .Pp | |
142 | .Pp | |
143 | .It·Fl·-verbose | |
| |
| 131 | .TP |
| 132 | \fB\--verbose\fP |
144 | Show·details. | 133 | Show·details. |
145 | .Pp | |
146 | .It·Fl·-noverbose | |
| 134 | .TP |
| 135 | \fB\--noverbose\fP |
147 | Don't·show·details. | 136 | Don't·show·details. |
148 | .Pp | |
149 | .It·Fl·-prompt·Ar·mode | |
150 | .It·Fl·-prompt-mode·Ar·mode | |
| 137 | .TP |
| 138 | \fB\--prompt\fP·\fImode\fP |
| 139 | .TP |
| 140 | \fB\--prompt-mode\fP·\fImode\fP |
151 | Switch·prompt·mode.·Pre-defined·prompt·modes·are | 141 | Switch·prompt·mode.·Pre-defined·prompt·modes·are |
152 | `default',·`simple',·`xmp'·and·`inf-ruby'. | 142 | `default',·`simple',·`xmp'·and·`inf-ruby'. |
153 | .Pp | |
154 | .It·Fl·-inf-ruby-mode | |
| 143 | .TP |
| 144 | \fB\--inf-ruby-mode\fP |
155 | Uses·prompt·appropriate·for·inf-ruby-mode·on·emacs. | 145 | Uses·prompt·appropriate·for·inf-ruby-mode·on·emacs. |
156 | Suppresses·--multiline·and·--singleline. | 146 | Suppresses·--multiline·and·--singleline. |
157 | .Pp | |
158 | .It·Fl·-simple-prompt | |
| 147 | .TP |
| 148 | \fB\--simple-prompt\fP |
159 | Makes·prompts·simple. | 149 | Makes·prompts·simple. |
160 | .Pp | |
161 | .It·Fl·-noprompt | |
| 150 | .TP |
| 151 | \fB\--noprompt\fP |
162 | No·prompt·mode. | 152 | No·prompt·mode. |
163 | .Pp | |
164 | .It·Fl·-tracer | |
| 153 | .TP |
| 154 | \fB\--tracer\fP |
165 | Displays·trace·for·each·execution·of·commands. | 155 | Displays·trace·for·each·execution·of·commands. |
166 | .Pp | |
167 | .It·Fl·-back-trace-limit·Ar·n | |
| 156 | .TP |
| 157 | \fB\--back-trace-limit\fP·\fIn\fP |
168 | Displays·backtrace·top | 158 | Displays·backtrace·top |
169 | .Ar·n | 159 | \fIn\fP |
170 | and·tail | 160 | and·tail |
171 | .Ar·n·Ns·. | 161 | \fIn\fP. |
172 | The·default·value·is·16. | 162 | The·default·value·is·16. |
| |
173 | .El | |
174 | .Pp | |
175 | .Sh·ENVIRONMENT | 163 | .SH·ENVIRONMENT |
176 | .Bl·-tag·-compact·-width·"XDG_CONFIG_HOME" | 164 | .TP |
177 | .It·Ev·IRB_LANG | 165 | .B·IRB_LANG |
178 | The·locale·used·for | 166 | The·locale·used·for |
179 | .Nm·. | |
180 | .Pp | |
181 | .It·Ev·IRBRC | 167 | \fB.\fP |
| |
| 168 | .TP |
| 169 | .B·IRBRC |
182 | The·path·to·the·personal·initialization·file. | 170 | The·path·to·the·personal·initialization·file. |
183 | .Pp | |
| 171 | .TP |
184 | .It·Ev·XDG_CONFIG_HOME | 172 | .B·XDG_CONFIG_HOME |
185 | .Nm | 173 | \fBirb\fP |
186 | respects·XDG_CONFIG_HOME.·If·this·is·set,·load | 174 | respects·XDG_CONFIG_HOME.·If·this·is·set,·load |
187 | .Pa·$XDG_CONFIG_HOME/irb/irbrc | 175 | \fI$XDG_CONFIG_HOME/irb/irbrc\fP |
188 | as·a·personal·initialization·file. | 176 | as·a·personal·initialization·file. |
| |
| |
189 | .Pp | |
190 | .El | |
191 | .Pp | |
192 | Also | 177 | Also |
193 | .Nm | 178 | \fBirb\fP |
194 | depends·on·same·variables·as | 179 | depends·on·same·variables·as |
195 | .Xr·ruby·1·. | |
196 | .Pp | 180 | \fBruby\fP(1). |
| |
197 | .Sh·FILES | 181 | .SH·FILES |
198 | .Bl·-tag·-compact | 182 | .TP |
199 | .It·Pa·~/.irbrc | 183 | .B·~/.irbrc |
200 | Personal·irb·initialization.·If | 184 | Personal·irb·initialization.·If |
201 | .Ev·IRBRC | 185 | .IR·IRBRC |
202 | is·set,·read | 186 | is·set,·read |
203 | .Pa·$IRBRC | 187 | \fI$IRBRC\fP |
204 | instead.·If | 188 | instead.·If |
205 | .Ev·IRBRC | 189 | .IR·IRBRC |
206 | is·not·set·and | 190 | is·not·set·and |
207 | .Ev·XDG_CONFIG_HOME | 191 | .IR·XDG_CONFIG_HOME |
208 | is·set, | 192 | is·set, |
209 | .Pa·$XDG_CONFIG_HOME/irb/irbrc | 193 | \fI$XDG_CONFIG_HOME/irb/irbrc\fP |
210 | is·loaded. | 194 | is·loaded. |
| |
| |
211 | .Pp | |
212 | .El | |
213 | .Pp | |
214 | .Sh·EXAMPLES | 195 | .SH·EXAMPLES |
215 | .Dl·%·irb | 196 | .nf |
| 197 | \&··%·irb |
| 198 | .fi |
| 199 | .nf |
216 | .Dl·irb(main):001:0>·Ic·1·+·1 | 200 | \&··irb(main):001:0>·\fB1·+·1\fP |
217 | .Dl·2 | 201 | .fi |
| 202 | .nf |
| 203 | \&··2 |
| 204 | .fi |
| 205 | .nf |
218 | .Dl·irb(main):002:0>·Ic·def·t(x) | 206 | \&··irb(main):002:0>·\fBdef·t(x)\fP |
219 | .Dl·irb(main):003:1>·Ic···x·+·1 | |
220 | .Dl·irb(main):004:1>·Ic·end | |
221 | .Dl·=>·:t | |
222 | .Dl·irb(main):005:0>·Ic·t(3) | |
223 | .Dl·=>·4 | 207 | .fi |
| 208 | .nf |
| 209 | \&··irb(main):003:1>·\fBx·+·1\fP |
| 210 | .fi |
| 211 | .nf |
| 212 | \&··irb(main):004:1>·\fBend\fP |
| 213 | .fi |
| 214 | .nf |
| 215 | \&··=>·:t |
| 216 | .fi |
| 217 | .nf |
| 218 | \&··irb(main):005:0>·\fBt(3)\fP |
| 219 | .fi |
| 220 | .nf |
| 221 | \&··=>·4 |
| 222 | .fi |
| 223 | .nf |
224 | .Dl·irb(main):006:0>·Ic·if·t(3)·==·4 | 224 | \&··irb(main):006:0>·\fBif·t(3)·==·4\fP |
| 225 | .fi |
| 226 | .nf |
225 | .Dl·irb(main):007:1>·Ic·p·:ok | 227 | \&··irb(main):007:1>·\fBp·:ok\fP |
226 | .Dl·irb(main):008:1>·Ic·end | |
227 | .Dl·:ok | |
228 | .Dl·=>·:ok | |
229 | .Dl·irb(main):009:0>·Ic·quit | |
230 | .Dl·% | |
231 | .Pp | 228 | .fi |
| 229 | .nf |
| 230 | \&··irb(main):008:1>·\fBend\fP |
| 231 | .fi |
| 232 | .nf |
| 233 | \&··:ok |
| 234 | .fi |
| 235 | .nf |
| 236 | \&··=>·:ok |
| 237 | .fi |
| 238 | .nf |
| 239 | \&··irb(main):009:0>·\fBquit\fP |
| 240 | .fi |
| 241 | .nf |
| 242 | \&··% |
| 243 | .fi |
| |
232 | .Sh·SEE·ALSO | 244 | .SH·SEE·ALSO |
233 | .Xr·ruby·1·. | |
234 | .Pp | 245 | \fBruby\fP(1). |
| |
235 | .Sh·REPORTING·BUGS | 246 | .SH·REPORTING·BUGS |
| 247 | .IP·\(bu |
236 | .Bl·-bullet | |
237 | .It | |
238 | Security·vulnerabilities·should·be·reported·via·an·email·to | 248 | Security·vulnerabilities·should·be·reported·via·an·email·to |
239 | .Mt·security@ruby-lang.org·. | 249 | Mt·security@ruby-lang.org. |
240 | Reported·problems·will·be·published·after·being·fixed. | 250 | Reported·problems·will·be·published·after·being·fixed. |
241 | .Pp | |
242 | .It | |
| 251 | .IP·\(bu |
243 | Other·bugs·and·feature·requests·can·be·reported·via·the | 252 | Other·bugs·and·feature·requests·can·be·reported·via·the |
244 | Ruby·Issue·Tracking·System | 253 | Ruby·Issue·Tracking·System |
245 | .Pq·Lk·https://bugs.ruby-lang.org/·. | 254 | (\fBhttps://bugs.ruby-lang.org/\fP). |
246 | Do·not·report·security·vulnerabilities | 255 | Do·not·report·security·vulnerabilities |
247 | via·this·system·because·it·publishes·the·vulnerabilities·immediately. | 256 | via·this·system·because·it·publishes·the·vulnerabilities·immediately. |
248 | .El | |
249 | .Sh·AUTHORS | 257 | .SH·AUTHORS |
250 | Written·by·Keiju·ISHITSUKA. | 258 | Written·by·Keiju·ISHITSUKA. |