| | | |
Offset 1, 247 lines modified | Offset 1, 270 lines modified |
1 | .\"Ruby·is·copyrighted·by·Yukihiro·Matsumoto·<matz@netlab.jp>. | |
2 | .Dd·April·20,·2017 | |
3 | .Dt·RI·\&1·"Ruby·Programmer's·Reference·Guide" | 1 | .TH·RI·\&1·"Ruby·Programmer's·Reference·Guide"·"April·20,·2017"·"UNIX" |
4 | .Os·UNIX | |
5 | .Sh·NAME | 2 | .SH·NAME |
6 | .Nm·ri | 3 | \fBri\fP |
7 | .Nd·Ruby·API·reference·front·end | 4 | \-·Ruby·API·reference·front·end |
8 | .Sh·SYNOPSIS | 5 | .SH·SYNOPSIS |
9 | .Nm | |
10 | .Op·Fl·ahilTv | |
11 | .Op·Fl·d·Ar·DIRNAME | |
12 | .Op·Fl·f·Ar·FORMAT | |
13 | .Op·Fl·w·Ar·WIDTH | |
14 | .Op·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·pager | |
15 | .Op·Fl·-server·Ns·Oo·=·Ns·Ar·PORT·Oc | |
16 | .Op·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·list-doc-dirs | |
17 | .Op·Fl·-no-standard-docs | |
18 | .Op·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Bro·Cm·system·Ns·|·Ns·Cm·site·Ns·|·Ns·Cm·gems·Ns·|·Ns·Cm·home·Brc | |
19 | .Op·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·profile | |
20 | .Op·Fl·-dump·Ns·=·Ns·Ar·CACHE | |
21 | .Op·Ar·name·... | 6 | .br |
| 7 | \fBri\fP |
| 8 | [\fB\-ahilTv\fP] |
| 9 | [\fB\-d\fP·\fIDIRNAME\fP] |
| 10 | [\fB\-f\fP·\fIFORMAT\fP] |
| 11 | [\fB\-w\fP·\fIWIDTH\fP] |
| 12 | [\fB\--\fP[\fBno-\fP]\fBpager\fP] |
| 13 | [\fB\--server\fP[=\fIPORT\fP]] |
| 14 | [\fB\--\fP[\fBno-\fP]\fBlist-doc-dirs\fP] |
| 15 | [\fB\--no-standard-docs\fP] |
| 16 | [\fB\--\fP[\fBno-\fP]{\fBsystem\fP|\fBsite\fP|\fBgems\fP|\fBhome\fP}] |
| 17 | [\fB\--\fP[\fBno-\fP]\fBprofile\fP] |
| 18 | [\fB\--dump\fP=\fICACHE\fP] |
| 19 | [\fIname\fP·...] |
22 | .Sh·DESCRIPTION | 20 | .SH·DESCRIPTION |
23 | .Nm | 21 | \fBri\fP |
24 | is·a·command-line·front·end·for·the·Ruby·API·reference. | 22 | is·a·command-line·front·end·for·the·Ruby·API·reference. |
25 | You·can·search·and·read·the·API·reference·for·classes·and·methods·with | 23 | You·can·search·and·read·the·API·reference·for·classes·and·methods·with |
26 | .Nm·. | |
27 | .Pp | |
28 | .Nm | 24 | \fB.\fP |
| |
| 25 | \fBri\fP |
29 | is·a·part·of·Ruby. | 26 | is·a·part·of·Ruby. |
30 | .Pp | |
31 | .Ar·name | |
| 27 | \fIname\fP |
32 | can·be: | 28 | can·be: |
33 | .Bl·-diag·-offset·indent | |
34 | .It·Class·|·Module·|·Module::Class | 29 | It·Class·|·Module·|·Module::Class |
35 | .Pp | |
36 | .It·Class::method·|·Class#method·|·Class.method·|·method | 30 | It·Class::method·|·Class#method·|·Class.method·|·method |
37 | .Pp | |
38 | .It·gem_name:·|·gem_name:README·|·gem_name:History | 31 | It·gem_name:·|·gem_name:README·|·gem_name:History |
| |
39 | .El | |
40 | .Pp | |
41 | All·class·names·may·be·abbreviated·to·their·minimum·unambiguous·form. | 32 | All·class·names·may·be·abbreviated·to·their·minimum·unambiguous·form. |
42 | If·a·name·is·ambiguous,·all·valid·options·will·be·listed. | 33 | If·a·name·is·ambiguous,·all·valid·options·will·be·listed. |
43 | .Pp | |
44 | A | 34 | A |
45 | .Ql·\&. | 35 | `\&.' |
46 | matches·either·class·or·instance·methods,·while·#method | 36 | matches·either·class·or·instance·methods,·while·#method |
47 | matches·only·instance·and·::method·matches·only·class·methods. | 37 | matches·only·instance·and·::method·matches·only·class·methods. |
48 | .Pp | |
49 | README·and·other·files·may·be·displayed·by·prefixing·them·with·the·gem·name | 38 | README·and·other·files·may·be·displayed·by·prefixing·them·with·the·gem·name |
50 | they're·contained·in.··If·the·gem·name·is·followed·by·a | 39 | they're·contained·in.··If·the·gem·name·is·followed·by·a |
51 | .Ql·\&: | 40 | `\&:' |
52 | all·files·in·the·gem·will·be·shown. | 41 | all·files·in·the·gem·will·be·shown. |
53 | The·file·name·extension·may·be·omitted·where·it·is·unambiguous. | 42 | The·file·name·extension·may·be·omitted·where·it·is·unambiguous. |
54 | .Pp | |
55 | For·example: | 43 | For·example: |
56 | .Bd·-literal·-offset·indent | |
57 | ri·Fil | 44 | ri·Fil |
| 45 | .br |
58 | ri·File | 46 | ri·File |
| 47 | .br |
59 | ri·File.new | 48 | ri·File.new |
| 49 | .br |
60 | ri·zip | 50 | ri·zip |
| 51 | .br |
61 | ri·rdoc:README | 52 | ri·rdoc:README |
62 | .Ed | |
63 | .Pp | 53 | .br |
| |
64 | Note·that·shell·quoting·or·escaping·may·be·required·for·method·names | 54 | Note·that·shell·quoting·or·escaping·may·be·required·for·method·names |
65 | containing·punctuation: | 55 | containing·punctuation: |
66 | .Bd·-literal·-offset·indent | |
67 | ri·'Array.[]' | 56 | ri·'Array.[]' |
| 57 | .br |
68 | ri·compact\e! | 58 | ri·compact\e! |
69 | .Ed | |
70 | .Pp | 59 | .br |
| |
71 | To·see·the·default·directories | 60 | To·see·the·default·directories |
72 | .Nm | 61 | \fBri\fP |
73 | will·search,·run: | 62 | will·search,·run: |
74 | .Bd·-literal·-offset·indent | |
75 | ri·--list-doc-dirs | 63 | ri·--list-doc-dirs |
76 | .Ed | |
77 | .Pp | 64 | .br |
| |
78 | Specifying·the | 65 | Specifying·the |
79 | .Fl·-system·,·Fl·-site·,·Fl·-home·,·Fl·-gems·, | 66 | \fB\--system\fP,\fB\--site\fP,\fB\--home\fP,\fB\--gems\fP, |
80 | or | 67 | or |
81 | .Fl·-doc-dir | 68 | \fB\--doc-dir\fP |
82 | options·will·limit | 69 | options·will·limit |
83 | .Nm | 70 | \fBri\fP |
84 | to·searching·only·the·specified·directories. | 71 | to·searching·only·the·specified·directories. |
85 | .Pp | |
86 | .Nm | |
| 72 | \fBri\fP |
87 | options·may·be·set·in·the | 73 | options·may·be·set·in·the |
88 | .Ev·RI | 74 | .IR·RI |
89 | environment·variable. | 75 | environment·variable. |
90 | .Pp | |
91 | The | 76 | The |
92 | .Nm | 77 | \fBri\fP |
93 | pager·can·be·set·with·the | 78 | pager·can·be·set·with·the |
94 | .Ev·RI_PAGER | 79 | .IR·RI_PAGER |
95 | environment·variable·or·the | 80 | environment·variable·or·the |
96 | .Ev·PAGER | 81 | .IR·PAGER |
97 | environment·variable. | 82 | environment·variable. |
98 | .Pp | |
99 | .Sh·OPTIONS | 83 | .SH·OPTIONS |
100 | .Bl·-tag·-width·"1234567890123"·-compact | |
101 | .Pp | |
102 | .It·Fl·i | |
103 | .It·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·interactive | |
| 84 | .TP |
| 85 | \fB\-i\fP |
| 86 | .TP |
| 87 | \fB\--\fP[\fBno-\fP]\fBinteractive\fP |
104 | In·interactive·mode·you·can·repeatedly | 88 | In·interactive·mode·you·can·repeatedly |
105 | look·up·methods·with·autocomplete. | 89 | look·up·methods·with·autocomplete. |
106 | .Pp | |
107 | .It·Fl·a | |
108 | .It·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·all | |
| 90 | .TP |
| 91 | \fB\-a\fP |
| 92 | .TP |
| 93 | \fB\--\fP[\fBno-\fP]\fBall\fP |
109 | Show·all·documentation·for·a·class·or·module. | 94 | Show·all·documentation·for·a·class·or·module. |
110 | .Pp | |
111 | .It·Fl·l | |
112 | .It·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·list | |
| 95 | .TP |
| 96 | \fB\-l\fP |
| 97 | .TP |
| 98 | \fB\--\fP[\fBno-\fP]\fBlist\fP |
113 | List·classes | 99 | List·classes |
114 | .Nm | 100 | \fBri\fP |
115 | knows·about. | 101 | knows·about. |
116 | .Pp | |
117 | .It·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·pager | |
| 102 | .TP |
| 103 | \fB\--\fP[\fBno-\fP]\fBpager\fP |
118 | Send·output·to·a·pager, | 104 | Send·output·to·a·pager, |
119 | rather·than·directly·to·stdout. | 105 | rather·than·directly·to·stdout. |
120 | .Pp | |
121 | .It·Fl·T | |
| 106 | .TP |
| 107 | \fB\-T\fP |
122 | Synonym·for | 108 | Synonym·for |
123 | .Fl·-no-pager·. | |
124 | .Pp | |
125 | .It·Fl·w·Ar·WIDTH | |
126 | .It·Fl·-width·Ns·=·Ns·Ar·WIDTH | 109 | \fB\--no-pager\fP. |
| |
| 110 | .TP |
| 111 | \fB\-w\fP·\fIWIDTH\fP |
| 112 | .TP |
| 113 | \fB\--width\fP=\fIWIDTH\fP |
127 | Set·the·width·of·the·output. | 114 | Set·the·width·of·the·output. |
128 | .Pp | |
129 | .It·Fl·-server·Ns·Oo·=·Ns·Ar·PORT·Oc | |
| 115 | .TP |
| 116 | \fB\--server\fP[=\fIPORT\fP] |
130 | Run·RDoc·server·on·the·given·port. | 117 | Run·RDoc·server·on·the·given·port. |
131 | The·default·port·is\~8214. | 118 | The·default·port·is\~8214. |
132 | .Pp | |
133 | .It·Fl·f·Ar·FORMAT | |
134 | .It·Fl·-format·Ns·=·Ns·Ar·FORMAT | |
| 119 | .TP |
| 120 | \fB\-f\fP·\fIFORMAT\fP |
| 121 | .TP |
| 122 | \fB\--format\fP=\fIFORMAT\fP |
135 | Use·the·selected·formatter. | 123 | Use·the·selected·formatter. |
136 | The·default·formatter·is | 124 | The·default·formatter·is |
137 | .Li·bs | 125 | bs |
138 | for·paged·output·and | 126 | for·paged·output·and |
139 | .Li·ansi | 127 | ansi |
140 | otherwise. | 128 | otherwise. |
141 | Valid·formatters·are: | 129 | Valid·formatters·are: |
142 | .Li·ansi·,·Li·bs·,·Li·markdown·,·Li·rdoc·. | |
143 | .Pp | |
144 | .It·Fl·h | |
145 | .It·Fl·-help | 130 | ansi,bs,markdown,rdoc. |
| |
| 131 | .TP |
| 132 | \fB\-h\fP |
| 133 | .TP |
| 134 | \fB\--help\fP |
146 | Show·help·and·exit. | 135 | Show·help·and·exit. |
147 | .Pp | |
148 | .It·Fl·v | |
149 | .It·Fl·-version | |
| 136 | .TP |
| 137 | \fB\-v\fP |
| 138 | .TP |
| 139 | \fB\--version\fP |
150 | Output·version·information·and·exit. | 140 | Output·version·information·and·exit. |
| |
151 | .El | |
152 | .Pp | |
153 | Data·source·options: | 141 | Data·source·options: |
154 | .Bl·-tag·-width·"1234567890123"·-compact | |
155 | .Pp | |
156 | .It·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·list-doc-dirs | |
| 142 | .TP |
| 143 | \fB\--\fP[\fBno-\fP]\fBlist-doc-dirs\fP |
157 | List·the·directories·from·which | 144 | List·the·directories·from·which |
158 | .Nm | 145 | \fBri\fP |
159 | will·source·documentation·on·stdout·and·exit. | 146 | will·source·documentation·on·stdout·and·exit. |
160 | .Pp | |
161 | .It·Fl·d·Ar·DIRNAME | |
162 | .It·Fl·-doc-dir·Ns·=·Ns·Ar·DIRNAME | |
| 147 | .TP |
| 148 | \fB\-d\fP·\fIDIRNAME\fP |
| 149 | .TP |
| 150 | \fB\--doc-dir\fP=\fIDIRNAME\fP |
163 | List·of·directories·from·which·to·source | 151 | List·of·directories·from·which·to·source |
164 | documentation·in·addition·to·the·standard | 152 | documentation·in·addition·to·the·standard |
165 | directories.··May·be·repeated. | 153 | directories.··May·be·repeated. |
166 | .Pp | |
167 | .It·Fl·-no-standard-docs | |
| 154 | .TP |
| 155 | \fB\--no-standard-docs\fP |
168 | Do·not·include·documentation·from·the·Ruby·standard·library, | 156 | Do·not·include·documentation·from·the·Ruby·standard·library, |
169 | .Pa·site_lib·, | 157 | \fIsite_lib\fP, |
170 | installed·gems,·or | 158 | installed·gems,·or |
171 | .Pa·~/.rdoc·. | 159 | \fI~/.rdoc\fP. |
172 | Use·with | 160 | Use·with |
173 | .Fl·-doc-dir·. | |
174 | .Pp | |
175 | .It·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·system | 161 | \fB\--doc-dir\fP. |
| |
| 162 | .TP |
| 163 | \fB\--\fP[\fBno-\fP]\fBsystem\fP |
176 | Include·documentation·from·Ruby's·standard·library.··Defaults·to·true. | 164 | Include·documentation·from·Ruby's·standard·library.··Defaults·to·true. |
177 | .Pp | |
178 | .It·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·site | |
| 165 | .TP |
| 166 | \fB\--\fP[\fBno-\fP]\fBsite\fP |
179 | Include·documentation·from·libraries·installed·in | 167 | Include·documentation·from·libraries·installed·in |
180 | .Pa·site_lib·. | 168 | \fIsite_lib\fP. |
181 | Defaults·to·true. | 169 | Defaults·to·true. |
182 | .Pp | |
183 | .It·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·gems | |
| 170 | .TP |
| 171 | \fB\--\fP[\fBno-\fP]\fBgems\fP |
184 | Include·documentation·from·RubyGems.··Defaults·to·true. | 172 | Include·documentation·from·RubyGems.··Defaults·to·true. |
185 | .Pp | |
186 | .It·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·home | |
| 173 | .TP |
| 174 | \fB\--\fP[\fBno-\fP]\fBhome\fP |
187 | Include·documentation·stored·in | 175 | Include·documentation·stored·in |
188 | .Pa·~/.rdoc·. | 176 | \fI~/.rdoc\fP. |
189 | Defaults·to·true. | 177 | Defaults·to·true. |
| |
190 | .El | |
191 | .Pp | |
192 | Debug·options: | 178 | Debug·options: |
193 | .Bl·-tag·-width·"1234567890123"·-compact | |
194 | .Pp | |
195 | .It·Fl·-·Ns·Oo·Cm·no-·Oc·Ns·Cm·profile | |
| 179 | .TP |
| 180 | \fB\--\fP[\fBno-\fP]\fBprofile\fP |
196 | Run·with·the·Ruby·profiler. | 181 | Run·with·the·Ruby·profiler. |
197 | .Pp | |
198 | .It·Fl·-dump·Ns·=·Ns·Ar·CACHE | |
| 182 | .TP |
| 183 | \fB\--dump\fP=\fICACHE\fP |
199 | Dump·data·from·an·ri·cache·or·data·file. | 184 | Dump·data·from·an·ri·cache·or·data·file. |
| |
200 | .El | |
201 | .Pp | |
202 | .Sh·ENVIRONMENT | 185 | .SH·ENVIRONMENT |
203 | .Bl·-tag·-width·"USERPROFILE"·-compact | |
204 | .Pp | |
205 | .It·Ev·RI | |
| 186 | .TP |
| 187 | .B·RI |
206 | Options·to·prepend·to·those·specified·on·the·command-line. | 188 | Options·to·prepend·to·those·specified·on·the·command-line. |
207 | .Pp | |
| 189 | .TP |
208 | .It·Ev·RI_PAGER | 190 | .B·RI_PAGER |
209 | .It·Ev·PAGER | 191 | .TP |
| 192 | .B·PAGER |
210 | Pager·program·to·use·for·displaying. | 193 | Pager·program·to·use·for·displaying. |
211 | .Pp | |
212 | .It·Ev·HOME | |
| 194 | .TP |
| 195 | .B·HOME |
| 196 | .TP |
213 | .It·Ev·USERPROFILE | 197 | .B·USERPROFILE |
| 198 | .TP |
214 | .It·Ev·HOMEPATH | 199 | .B·HOMEPATH |
215 | Path·to·the·user's·home·directory. | 200 | Path·to·the·user's·home·directory. |
| |
216 | .El | |
217 | .Pp | |
218 | .Sh·FILES | 201 | .SH·FILES |
219 | .Bl·-tag·-width·"USERPROFILE"·-compact | |
220 | .Pp | |
| 202 | .TP |
221 | .It·Pa·~/.rdoc | 203 | .B·~/.rdoc |
222 | Path·for·ri·data·in·the·user's·home·directory. | 204 | Path·for·ri·data·in·the·user's·home·directory. |
| |
| |
223 | .Pp | |
224 | .El | |
225 | .Pp | |
226 | .Sh·SEE·ALSO | 205 | .SH·SEE·ALSO |
227 | .Xr·ruby·1·, | |
228 | .Xr·rdoc·1·, | |
229 | .Xr·gem·1 | |
230 | .Pp | 206 | \fBruby\fP(1), |
| 207 | \fBrdoc\fP(1), |
| 208 | \fBgem\fP(1) |
| |
231 | .Sh·REPORTING·BUGS | 209 | .SH·REPORTING·BUGS |
| 210 | .IP·\(bu |
232 | .Bl·-bullet | |
233 | .It | |
234 | Security·vulnerabilities·should·be·reported·via·an·email·to | 211 | Security·vulnerabilities·should·be·reported·via·an·email·to |
235 | .Mt·security@ruby-lang.org·. | 212 | Mt·security@ruby-lang.org. |
236 | Reported·problems·will·be·published·after·being·fixed. | 213 | Reported·problems·will·be·published·after·being·fixed. |
237 | .Pp | |
238 | .It | |
| 214 | .IP·\(bu |
239 | Other·bugs·and·feature·requests·can·be·reported·via·the | 215 | Other·bugs·and·feature·requests·can·be·reported·via·the |
240 | Ruby·Issue·Tracking·System | 216 | Ruby·Issue·Tracking·System |
241 | .Pq·Lk·https://bugs.ruby-lang.org/·. | 217 | (\fBhttps://bugs.ruby-lang.org/\fP). |
242 | Do·not·report·security·vulnerabilities | 218 | Do·not·report·security·vulnerabilities |
243 | via·this·system·because·it·publishes·the·vulnerabilities·immediately. | 219 | via·this·system·because·it·publishes·the·vulnerabilities·immediately. |
244 | .El | |
245 | .Sh·AUTHORS | 220 | .SH·AUTHORS |
246 | Written·by | 221 | Written·by |
247 | .An·Dave·Thomas·Aq·dave@pragmaticprogrammer.com·. | 222 | Dave·Thomas·<dave@pragmaticprogrammer.com>. |