| | | | |
| Offset 1, 229 lines modified | Offset 1, 290 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 |
| | 164 | .TP |
| | 165 | .B·IRBRC |
| | |
| | |
| 176 | .Bl·-tag·-compact | |
| 177 | .It·Ev·IRBRC | |
| 178 | .Pp | |
| 179 | .El | |
| 180 | .Pp | |
| 181 | Also | 166 | Also |
| 182 | .Nm | 167 | \fBirb\fP |
| 183 | depends·on·same·variables·as | 168 | depends·on·same·variables·as |
| 184 | .Xr·ruby·1·. | |
| 185 | .Pp | 169 | \fBruby\fP(1). |
| | |
| 186 | .Sh·FILES | 170 | .SH·FILES |
| 187 | .Bl·-tag·-compact | 171 | .TP |
| 188 | .It·Pa·~/.irbrc | 172 | .B·~/.irbrc |
| 189 | Personal·irb·initialization. | 173 | Personal·irb·initialization. |
| | |
| | |
| 190 | .Pp | |
| 191 | .El | |
| 192 | .Pp | |
| 193 | .Sh·EXAMPLES | 174 | .SH·EXAMPLES |
| 194 | .Dl·%·irb | 175 | .nf |
| | 176 | \&··%·irb |
| | 177 | .fi |
| | 178 | .nf |
| 195 | .Dl·irb(main):001:0>·Ic·1·+·1 | 179 | \&··irb(main):001:0>·\fB1·+·1\fP |
| 196 | .Dl·2 | 180 | .fi |
| | 181 | .nf |
| | 182 | \&··2 |
| | 183 | .fi |
| | 184 | .nf |
| 197 | .Dl·irb(main):002:0>·Ic·def·t(x) | 185 | \&··irb(main):002:0>·\fBdef·t(x)\fP |
| 198 | .Dl·irb(main):003:1>·Ic···x·+·1 | |
| 199 | .Dl·irb(main):004:1>·Ic·end | |
| 200 | .Dl·=>·:t | |
| 201 | .Dl·irb(main):005:0>·Ic·t(3) | |
| 202 | .Dl·=>·4 | 186 | .fi |
| | 187 | .nf |
| | 188 | \&··irb(main):003:1>·\fBx·+·1\fP |
| | 189 | .fi |
| | 190 | .nf |
| | 191 | \&··irb(main):004:1>·\fBend\fP |
| | 192 | .fi |
| | 193 | .nf |
| | 194 | \&··=>·:t |
| | 195 | .fi |
| | 196 | .nf |
| | 197 | \&··irb(main):005:0>·\fBt(3)\fP |
| | 198 | .fi |
| | 199 | .nf |
| | 200 | \&··=>·4 |
| | 201 | .fi |
| | 202 | .nf |
| 203 | .Dl·irb(main):006:0>·Ic·if·t(3)·==·4 | 203 | \&··irb(main):006:0>·\fBif·t(3)·==·4\fP |
| | 204 | .fi |
| | 205 | .nf |
| 204 | .Dl·irb(main):007:1>·Ic·p·:ok | 206 | \&··irb(main):007:1>·\fBp·:ok\fP |
| 205 | .Dl·irb(main):008:1>·Ic·end | |
| 206 | .Dl·:ok | |
| 207 | .Dl·=>·:ok | |
| 208 | .Dl·irb(main):009:0>·Ic·quit | |
| 209 | .Dl·% | |
| 210 | .Pp | 207 | .fi |
| | 208 | .nf |
| | 209 | \&··irb(main):008:1>·\fBend\fP |
| | 210 | .fi |
| | 211 | .nf |
| | 212 | \&··:ok |
| | 213 | .fi |
| | 214 | .nf |
| | 215 | \&··=>·:ok |
| | 216 | .fi |
| | 217 | .nf |
| | 218 | \&··irb(main):009:0>·\fBquit\fP |
| | 219 | .fi |
| | 220 | .nf |
| | 221 | \&··% |
| | 222 | .fi |
| | |
| 211 | .Sh·SEE·ALSO | 223 | .SH·SEE·ALSO |
| 212 | .Xr·ruby·1·. | |
| 213 | .Pp | 224 | \fBruby\fP(1). |
| | |
| 214 | .Sh·REPORTING·BUGS | 225 | .SH·REPORTING·BUGS |
| | 226 | .IP·\(bu |
| 215 | .Bl·-bullet | |
| 216 | .It | |
| 217 | Security·vulnerabilities·should·be·reported·via·an·email·to | 227 | Security·vulnerabilities·should·be·reported·via·an·email·to |
| 218 | .Mt·security@ruby-lang.org·. | 228 | Mt·security@ruby-lang.org. |
| 219 | Reported·problems·will·be·published·after·being·fixed. | 229 | Reported·problems·will·be·published·after·being·fixed. |
| 220 | .Pp | |
| 221 | .It | |
| | 230 | .IP·\(bu |
| 222 | Other·bugs·and·feature·requests·can·be·reported·via·the | 231 | Other·bugs·and·feature·requests·can·be·reported·via·the |
| 223 | Ruby·Issue·Tracking·System | 232 | Ruby·Issue·Tracking·System |
| 224 | .Pq·Lk·https://bugs.ruby-lang.org/·. | 233 | (\fBhttps://bugs.ruby-lang.org/\fP). |
| 225 | Do·not·report·security·vulnerabilities | 234 | Do·not·report·security·vulnerabilities |
| 226 | via·this·system·because·it·publishes·the·vulnerabilities·immediately. | 235 | via·this·system·because·it·publishes·the·vulnerabilities·immediately. |
| 227 | .El | |
| 228 | .Sh·AUTHORS | 236 | .SH·AUTHORS |
| 229 | Written·by·Keiju·ISHITSUKA. | 237 | Written·by·Keiju·ISHITSUKA. |