rdoc 8.0.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -3
  3. data/RI.md +75 -75
  4. data/exe/rdoc +2 -2
  5. data/lib/rdoc/code_object/alias.rb +71 -69
  6. data/lib/rdoc/code_object/any_method.rb +305 -303
  7. data/lib/rdoc/code_object/attr.rb +150 -148
  8. data/lib/rdoc/code_object/class_module.rb +798 -792
  9. data/lib/rdoc/code_object/constant.rb +175 -173
  10. data/lib/rdoc/code_object/context/section.rb +142 -138
  11. data/lib/rdoc/code_object/context.rb +926 -958
  12. data/lib/rdoc/code_object/extend.rb +7 -5
  13. data/lib/rdoc/code_object/include.rb +7 -5
  14. data/lib/rdoc/code_object/method_attr.rb +326 -319
  15. data/lib/rdoc/code_object/mixin.rb +97 -95
  16. data/lib/rdoc/code_object/normal_class.rb +77 -78
  17. data/lib/rdoc/code_object/normal_module.rb +61 -59
  18. data/lib/rdoc/code_object/require.rb +23 -39
  19. data/lib/rdoc/code_object/single_class.rb +21 -19
  20. data/lib/rdoc/code_object/top_level.rb +212 -219
  21. data/lib/rdoc/code_object.rb +305 -303
  22. data/lib/rdoc/comment.rb +275 -273
  23. data/lib/rdoc/cross_reference.rb +192 -190
  24. data/lib/rdoc/encoding.rb +105 -103
  25. data/lib/rdoc/erb_partial.rb +13 -11
  26. data/lib/rdoc/erbio.rb +29 -27
  27. data/lib/rdoc/generator/aliki.rb +161 -153
  28. data/lib/rdoc/generator/darkfish.rb +645 -635
  29. data/lib/rdoc/generator/json_index.rb +233 -229
  30. data/lib/rdoc/generator/markup.rb +164 -146
  31. data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
  32. data/lib/rdoc/generator/pot/po.rb +52 -51
  33. data/lib/rdoc/generator/pot/po_entry.rb +138 -132
  34. data/lib/rdoc/generator/pot.rb +85 -81
  35. data/lib/rdoc/generator/ri.rb +23 -19
  36. data/lib/rdoc/generator/template/aliki/DESIGN.md +6 -4
  37. data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
  38. data/lib/rdoc/generator/template/aliki/_head.rhtml +10 -10
  39. data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
  40. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
  41. data/lib/rdoc/generator/template/aliki/css/rdoc.css +207 -178
  42. data/lib/rdoc/generator/template/aliki/js/aliki.js +60 -84
  43. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
  44. data/lib/rdoc/generator.rb +48 -46
  45. data/lib/rdoc/i18n/locale.rb +99 -95
  46. data/lib/rdoc/i18n/text.rb +109 -105
  47. data/lib/rdoc/i18n.rb +7 -5
  48. data/lib/rdoc/markdown/byte_runtime.rb +80 -0
  49. data/lib/rdoc/markdown.kpeg +15 -11
  50. data/lib/rdoc/markdown.rb +40 -47
  51. data/lib/rdoc/markup/block_quote.rb +12 -8
  52. data/lib/rdoc/markup/document.rb +127 -123
  53. data/lib/rdoc/markup/formatter.rb +219 -215
  54. data/lib/rdoc/markup/include.rb +33 -29
  55. data/lib/rdoc/markup/indented_paragraph.rb +37 -33
  56. data/lib/rdoc/markup/inline_parser.rb +281 -277
  57. data/lib/rdoc/markup/list.rb +80 -88
  58. data/lib/rdoc/markup/list_item.rb +73 -85
  59. data/lib/rdoc/markup/paragraph.rb +23 -19
  60. data/lib/rdoc/markup/parser.rb +501 -497
  61. data/lib/rdoc/markup/pre_process.rb +283 -279
  62. data/lib/rdoc/markup/raw.rb +2 -2
  63. data/lib/rdoc/markup/rule.rb +16 -12
  64. data/lib/rdoc/markup/to_ansi.rb +143 -139
  65. data/lib/rdoc/markup/to_bs.rb +72 -68
  66. data/lib/rdoc/markup/to_html.rb +594 -565
  67. data/lib/rdoc/markup/to_html_crossref.rb +234 -230
  68. data/lib/rdoc/markup/to_html_snippet.rb +232 -227
  69. data/lib/rdoc/markup/to_joined_paragraph.rb +36 -32
  70. data/lib/rdoc/markup/to_label.rb +63 -59
  71. data/lib/rdoc/markup/to_markdown.rb +212 -208
  72. data/lib/rdoc/markup/to_rdoc.rb +336 -332
  73. data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
  74. data/lib/rdoc/markup/to_test.rb +60 -56
  75. data/lib/rdoc/markup/to_tt_only.rb +84 -80
  76. data/lib/rdoc/markup/verbatim.rb +62 -58
  77. data/lib/rdoc/markup.rb +198 -196
  78. data/lib/rdoc/options.rb +1063 -1061
  79. data/lib/rdoc/parser/c.rb +1039 -1037
  80. data/lib/rdoc/parser/changelog.rb +319 -315
  81. data/lib/rdoc/parser/markdown.rb +17 -13
  82. data/lib/rdoc/parser/rbs.rb +239 -235
  83. data/lib/rdoc/parser/rd.rb +17 -13
  84. data/lib/rdoc/parser/ruby.rb +1245 -1124
  85. data/lib/rdoc/parser/ruby_colorizer.rb +263 -213
  86. data/lib/rdoc/parser/simple.rb +31 -27
  87. data/lib/rdoc/parser/text.rb +12 -8
  88. data/lib/rdoc/parser.rb +228 -220
  89. data/lib/rdoc/rbs_helper.rb +1 -1
  90. data/lib/rdoc/rd/inline.rb +57 -53
  91. data/lib/rdoc/rd.rb +90 -88
  92. data/lib/rdoc/rdoc.rb +500 -491
  93. data/lib/rdoc/ri/driver.rb +1140 -1135
  94. data/lib/rdoc/ri/formatter.rb +7 -3
  95. data/lib/rdoc/ri/paths.rb +140 -136
  96. data/lib/rdoc/ri/servlet.rb +354 -350
  97. data/lib/rdoc/ri/store.rb +4 -2
  98. data/lib/rdoc/ri/task.rb +55 -51
  99. data/lib/rdoc/ri.rb +14 -12
  100. data/lib/rdoc/rubygems_hook.rb +183 -181
  101. data/lib/rdoc/server.rb +349 -347
  102. data/lib/rdoc/stats/normal.rb +46 -42
  103. data/lib/rdoc/stats/quiet.rb +39 -35
  104. data/lib/rdoc/stats/verbose.rb +35 -31
  105. data/lib/rdoc/stats.rb +365 -363
  106. data/lib/rdoc/store.rb +888 -902
  107. data/lib/rdoc/task.rb +260 -256
  108. data/lib/rdoc/text.rb +135 -133
  109. data/lib/rdoc/token_stream.rb +101 -93
  110. data/lib/rdoc/tom_doc.rb +203 -201
  111. data/lib/rdoc/version.rb +1 -1
  112. metadata +4 -5
  113. data/lib/rdoc/markdown/literals.kpeg +0 -21
  114. data/lib/rdoc/markdown/literals.rb +0 -454
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a89bb304f22c095d76899a316b1ec9eefdb803303046da663dcd6c3bd52c370d
4
- data.tar.gz: 2d76488b188447465d43934b24ff7ef3d1ec6c6f314512d86e8b7e0eb4185268
3
+ metadata.gz: 8bd46d161ae9d2249a6e2ea1afdb46e08cdc737260427c472fe39981d6ea6d00
4
+ data.tar.gz: 81e455d982e6e564e84058ba420aa59ee9d7792f93de961051d705bada6cd4f0
5
5
  SHA512:
6
- metadata.gz: d16d33de20366fadd59956e72dbffe115b0837ff10e37282bfec7b5420ebb5d177ddede87bafb2f735d9b5aca944558d6f60634004020c0d023dcef40852bc3d
7
- data.tar.gz: d0105f405dd7f6c9debbe3ec1b47d0365a637a68bd291bda10b446cc5094929a6f40cec90a57981641f8d0741a42bf1447c03dda2b0772a44b3b9927b5b52717
6
+ metadata.gz: 3a9fb465374b2b6fa07e949c50284394377b48657de07da3a78604f2b646558a4ebe4dc06aaea4e773f185370256971c5563159ab1c0dab6bd5b65cc3e2a94f3
7
+ data.tar.gz: 99b8a3b9ac9b568a4ab8a23fa3cd5dd6b1385f562d800a54094d533bf153b3696337d217df999f94c88236049a357f3fa655b592cba7106f50829e9d72f4d02f
data/CONTRIBUTING.md CHANGED
@@ -115,7 +115,6 @@ bundle exec rake verify_generated
115
115
  - `lib/rdoc/rd/block_parser.ry` → generates `block_parser.rb` via racc
116
116
  - `lib/rdoc/rd/inline_parser.ry` → generates `inline_parser.rb` via racc
117
117
  - `lib/rdoc/markdown.kpeg` → generates `markdown.rb` via kpeg
118
- - `lib/rdoc/markdown/literals.kpeg` → generates `literals.rb` via kpeg
119
118
 
120
119
  **Important:**
121
120
 
@@ -176,8 +175,7 @@ lib/rdoc/
176
175
  ├── markdown.kpeg # Parser source (edit this)
177
176
  ├── markdown.rb # Generated parser (do not edit)
178
177
  ├── markdown/ # Markdown parsing
179
- │ ├── literals.kpeg # Parser source (edit this)
180
- │ └── literals.rb # Generated parser (do not edit)
178
+ │ └── byte_runtime.rb # Byte-offset parser runtime
181
179
  ├── rd/ # RD format parsing
182
180
  │ ├── block_parser.ry # Parser source (edit this)
183
181
  │ ├── block_parser.rb # Generated parser (do not edit)
data/RI.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # `ri`: Ruby Information
2
2
 
3
- `ri` (<b>r</b>uby <b>i</b>nformation) is the Ruby command-line utility
4
- that gives fast and easy on-line access to Ruby documentation.
3
+ `ri` (<b>r</b>uby <b>i</b>nformation) is a Ruby command-line utility
4
+ that gives fast and easy online access to Ruby documentation.
5
5
 
6
6
  `ri` can show documentation for Ruby itself and for its installed gems:
7
7
 
@@ -45,10 +45,10 @@ the [Ruby online documentation](https://docs.ruby-lang.org/en/master):
45
45
 
46
46
  - The `ri` documentation is always available, even when you do not have internet access
47
47
  (think: airplane mode).
48
- - If you are working in a terminal window, typing `ri _whatever_` (or just `ri`)
48
+ - If you are working in a terminal window, typing `ri <whatever>` (or just `ri`)
49
49
  may be faster than navigating to a browser window and searching for documentation.
50
50
  - If you are working in an
51
- [irb \(interactive Ruby\)](https://ruby.github.io/irb/index.html)
51
+ [IRB \(Interactive Ruby\)][9]
52
52
  session, you _already_ have immediate access to `ri`:
53
53
  just type `'show_doc'`.
54
54
 
@@ -82,7 +82,7 @@ In both modes, static and interactive,
82
82
  `ri` responds to an input _name_ that specifies what is to be displayed:
83
83
  a document, multiple documents, or other information:
84
84
 
85
- - Static mode (in the shell): type `'ri _name_'`;
85
+ - Static mode (in the shell): run `ri <name>`;
86
86
  examples (output omitted):
87
87
 
88
88
  ```sh
@@ -109,17 +109,17 @@ a document, multiple documents, or other information:
109
109
  These example `ri` commands cite names for class and module documents
110
110
  (see [details and examples][3]):
111
111
 
112
- | Command | Shows |
113
- |------------------------------|------------------------------------------------------------|
114
- | ri File | Document for Ruby class File. |
115
- | ri File::Stat | Document for Ruby nested class File::Stat. |
116
- | ri Enumerable | Document for Ruby module Enumerable. |
117
- | ri Arr | Document for Ruby class Array (unique initial characters). |
118
- | ri Nokogiri::HTML4::Document | Document for gem class Nokogiri::HTML4::Document. |
119
- | ri Nokogiri | Document for gem module Nokogiri. |
112
+ | Command | Shows |
113
+ |--------------------------------|--------------------------------------------------------------|
114
+ | `ri File` | Document for Ruby class `File`. |
115
+ | `ri File::Stat` | Document for Ruby nested class `File::Stat`. |
116
+ | `ri Enumerable` | Document for Ruby module `Enumerable`. |
117
+ | `ri Arr` | Document for Ruby class `Array` (unique initial characters). |
118
+ | `ri Nokogiri::HTML4::Document` | Document for gem class `Nokogiri::HTML4::Document`. |
119
+ | `ri Nokogiri` | Document for gem module `Nokogiri`. |
120
120
  <br>
121
121
 
122
- If [option \\--all][4]
122
+ If [option `--all`][4]
123
123
  is in effect, documents for the methods in the named class or module
124
124
  are included in the display.
125
125
 
@@ -128,16 +128,16 @@ are included in the display.
128
128
  These example `ri` commands cite names for method documents
129
129
  (see [details and examples][5]):
130
130
 
131
- | Command | Shows |
132
- |--------------------------------------|----------------------------------------------------------------------------------|
133
- | ri IO::readlines | Document for Ruby class method IO::readlines. |
134
- | ri IO#readlines | Document for Ruby instance method IO::readlines. |
135
- | ri IO.readlines | Documents for Ruby instance method IO::readlines and class method IO::readlines. |
136
- | ri ::readlines | Documents for all class methods ::readlines. |
137
- | ri #readlines | Documents for all instance methods #readlines. |
138
- | ri .readlines, ri readlines | Documents for class methods ::readlines and instance methods #readlines. |
139
- | ri Nokogiri::HTML4::Document::parse | Document for gem class method Nokogiri::HTML4::Document::parse. |
140
- | ri Nokogiri::HTML4::Document#fragment | Document for gem instance method Nokogiri::HTML4::Document#fragment. |
131
+ | Command | Shows |
132
+ |-----------------------------------------|--------------------------------------------------------------------------------------|
133
+ | `ri IO::readlines` | Document for Ruby class method `IO::readlines`. |
134
+ | `ri IO#readlines` | Document for Ruby instance method `IO#readlines`. |
135
+ | `ri IO.readlines` | Documents for Ruby class method `IO::readlines` and instance method `IO#readlines`. |
136
+ | `ri ::readlines` | Documents for all class methods `::readlines`. |
137
+ | `ri #readlines` | Documents for all instance methods `#readlines`. |
138
+ | `ri .readlines`, `ri readlines` | Documents for all class methods `::readlines` and all instance methods `#readlines`. |
139
+ | `ri Nokogiri::HTML4::Document::parse` | Document for gem class method `Nokogiri::HTML4::Document::parse`. |
140
+ | `ri Nokogiri::HTML4::Document#fragment` | Document for gem instance method `Nokogiri::HTML4::Document#fragment`. |
141
141
  <br>
142
142
 
143
143
  ### Names for Page Documents
@@ -145,12 +145,12 @@ These example `ri` commands cite names for method documents
145
145
  These example `ri` commands cite names for page documents
146
146
  (see [details and examples][6]):
147
147
 
148
- | Command | Shows |
149
- |--------------------------------|--------------------------------------------------|
150
- | ri ruby:syntax/assignment.rdoc | Document for Ruby page assignment. |
151
- | ri ruby:syntax/assignment | Same document, if no other syntax/assignment.*. |
152
- | ri ruby:assignment | Same document, if no other */assignment.*. |
153
- | ri nokogiri:README.md | Document for page README.md. |
148
+ | Command | Shows |
149
+ |----------------------------------|----------------------------------------------------|
150
+ | `ri ruby:syntax/assignment.rdoc` | Document for Ruby page "assignment". |
151
+ | `ri ruby:syntax/assignment` | Same document, if no other "syntax/assignment.\*". |
152
+ | `ri ruby:assignment` | Same document, if no other "\*/assignment.\*". |
153
+ | `ri nokogiri:README.md` | Document for page "README.md". |
154
154
  <br>
155
155
 
156
156
  ### Names for Lists
@@ -158,14 +158,14 @@ These example `ri` commands cite names for page documents
158
158
  These example `ri` commands cite names for lists
159
159
  (see [details and examples][7]):
160
160
 
161
- | Command | Shows |
162
- |---------------|-------------------------|
163
- | ri ruby: | List of Ruby pages. |
164
- | ri nokogiri: | List of Nokogiri pages. |
161
+ | Command | Shows |
162
+ |----------------|-------------------------|
163
+ | `ri ruby:` | List of Ruby pages. |
164
+ | `ri nokogiri:` | List of Nokogiri pages. |
165
165
  <br>
166
166
 
167
167
  There are more lists available;
168
- see [option \\--list][8].
168
+ see [option `--list`][8].
169
169
 
170
170
  ## Pro Tips
171
171
 
@@ -175,8 +175,8 @@ If you are a frequent `ri` user,
175
175
  you can save time by keeping open a dedicated command window
176
176
  with either of:
177
177
 
178
- - A running [interactive ri][2] session.
179
- - A running [irb session][9];
178
+ - A running [interactive `ri`][2] session.
179
+ - A running [`irb` session][9];
180
180
  type `'show_doc'` to enter `ri`, newline to exit.
181
181
 
182
182
  When you switch to that window, `ri` is ready to respond quickly,
@@ -199,7 +199,7 @@ $ RI_PAGER="grep . | less" ri Array
199
199
  ```
200
200
 
201
201
  See the documentation for your chosen pager programs
202
- (e.g, type `'grep --help'`, `'less --help'`).
202
+ (e.g, run `grep --help`, `less --help`).
203
203
 
204
204
  ### Links in `ri` Output
205
205
 
@@ -254,10 +254,10 @@ When you see:
254
254
  - `ri` output can be large;
255
255
  to save space, an example may pipe it to one of these:
256
256
 
257
- - [head](https://www.man7.org/linux/man-pages/man1/head.1.html): leading lines only.
258
- - [tail](https://www.man7.org/linux/man-pages/man1/tail.1.html): trailing lines only.
259
- - [wc -l](https://www.man7.org/linux/man-pages/man1/wc.1.html): line count only.
260
- - [grep](https://www.man7.org/linux/man-pages/man1/grep.1.html): selected lines only.
257
+ - [`head`](https://www.man7.org/linux/man-pages/man1/head.1.html): leading lines only.
258
+ - [`tail`](https://www.man7.org/linux/man-pages/man1/tail.1.html): trailing lines only.
259
+ - [`wc -l`](https://www.man7.org/linux/man-pages/man1/wc.1.html): line count only.
260
+ - [`grep`](https://www.man7.org/linux/man-pages/man1/grep.1.html): selected lines only.
261
261
 
262
262
  - An example that involves a gem assumes that gems `nokogiri` and `minitest` are installed.
263
263
 
@@ -268,15 +268,15 @@ in the `ri` document for a class, module, method, or page.
268
268
 
269
269
  See also:
270
270
 
271
- - [Pager][10].
272
- - [Links in ri Output][11].
271
+ - [Pager][10]
272
+ - [Links in `ri` Output][11]
273
273
 
274
274
  ### Class and Module Documents
275
275
 
276
276
  The document for a class or module shows:
277
277
 
278
- - The class or module name, along with its parent class if any.
279
- - Where it's defined (Ruby core or gem).
278
+ - The class or module name, along with its parent class, if any.
279
+ - Where it's defined (Ruby core or a gem).
280
280
  - When each exists:
281
281
 
282
282
  - The names of its included modules.
@@ -335,7 +335,7 @@ $ ri IO | grep "^= "
335
335
 
336
336
  The document for a method includes:
337
337
 
338
- - The source of the method: `'(from ruby core)'` or `'(from gem _gem_)'`.
338
+ - The source of the method: `'(from ruby core)'` or `'(from gem <gem>)'`.
339
339
  - The calling sequence(s) for the method.
340
340
  - The text of its embedded documentation (if it exists).
341
341
 
@@ -374,7 +374,7 @@ the number of such implementations depends on the _name_:
374
374
  - Within a class:
375
375
 
376
376
  Each of these commands shows documents
377
- for methods in Ruby class `IO` (output omitted):
377
+ for methods in the Ruby class `IO` (output omitted):
378
378
 
379
379
  ```sh
380
380
  $ ri IO::readlines # Class method ::readlines.
@@ -467,7 +467,7 @@ rdoc:
467
467
 
468
468
  ## `ri` Lists
469
469
 
470
- The list of Ruby pages is available via _name_ `'ruby:'`:
470
+ The list of Ruby pages is available via the _name_ `'ruby:'`:
471
471
 
472
472
  ```sh
473
473
  $ ri ruby: | head
@@ -497,7 +497,7 @@ syntax/refinements.rdoc
497
497
  win32/README.win32
498
498
  ```
499
499
 
500
- The list of gem pages is available via _name_ `'_gem_name_'`:
500
+ The list of gem pages is available via the _name_ `'<gem_name>:'`:
501
501
 
502
502
  ```sh
503
503
  $ ri nokogiri: | head
@@ -509,9 +509,9 @@ lib/nokogiri/css/tokenizer.rex
509
509
 
510
510
  See also:
511
511
 
512
- - [Option \\--list][8]:
512
+ - [Option `--list`][8]:
513
513
  lists classes and modules.
514
- - [Option \\--list-doc-dirs][12]:
514
+ - [Option `--list-doc-dirs`][12]:
515
515
  lists `ri` source directories.
516
516
 
517
517
  ## `ri` Information
@@ -519,12 +519,12 @@ See also:
519
519
  With certain options,
520
520
  an `ri` command may display information other than documents or lists:
521
521
 
522
- - [Option \\--help or -h][13]:
522
+ - [Option `--help` or `-h`][13]:
523
523
  Shows `ri` help text.
524
- - [option \\--version or -v][14]:
524
+ - [Option `--version` or `-v`][14]:
525
525
  Shows `ri` version.
526
- - [Option \\--dump=FILEPATH][15]:
527
- Shows dump of `ri` cache file at the given filepath.
526
+ - [Option `--dump=FILEPATH`][15]:
527
+ Shows a dump of `ri` cache file at the given filepath.
528
528
 
529
529
  ## Static Mode
530
530
 
@@ -549,7 +549,7 @@ elements. Any object may be an Array element.
549
549
 
550
550
  `ri` also responds in static mode when certain options are given,
551
551
  even when no _name_ is given;
552
- see [ri Information][16].
552
+ see [`ri` Information][16].
553
553
 
554
554
  ## Interactive Mode
555
555
 
@@ -565,18 +565,18 @@ Enter a blank line to exit.
565
565
 
566
566
  ```
567
567
 
568
- A command in interactive mode are similar to one in static mode,
568
+ A command in interactive mode is similar to one in static mode,
569
569
  except that it:
570
570
 
571
- - Omits command word `ri`; you just type the _name_.
571
+ - Omits the command word `ri`; you just type the _name_.
572
572
  - Omits options; in interactive mode the only options in effect
573
573
  are those taken from environment variable `RI`.
574
574
  See [Options][17].
575
575
  - Supports tab auto-completion for the name of a class, module, or method;
576
- when, for example, you type `"Arr\t"` (here `"\t` represents the tab character),
576
+ when, for example, you type `"Arr\t"` (here `\t` represents the tab character),
577
577
  `ri` "completes" the text as `'Array '`.
578
578
 
579
- See also [ri at the Ready][18].
579
+ See also [`ri` at the Ready][18].
580
580
 
581
581
  ## Pager
582
582
 
@@ -592,7 +592,7 @@ which is the program whose name is the first-found among:
592
592
 
593
593
  If none is found, the output goes directly to `$stdout`, with no pager.
594
594
 
595
- If you set environment variable `RI_PAGER` or `PAGER`,
595
+ If you set the environment variable `RI_PAGER` or `PAGER`,
596
596
  its value should be the name of an executable program
597
597
  that will accept the `ri` output (such as `'pager'`, `'less'`, or `'more'`).
598
598
 
@@ -601,9 +601,9 @@ See also [Output Filters][19].
601
601
  ## Options
602
602
 
603
603
  Options may be given on the `ri` command line;
604
- those should be whitespace-separated, and must precede the given _name_, if any.
604
+ those should be whitespace-separated and must precede the given _name_, if any.
605
605
 
606
- Options may also be specified in environment variable `RI`;
606
+ Options may also be specified in the environment variable `RI`;
607
607
  those should also be whitespace-separated.
608
608
 
609
609
  An option specified in environment variable `RI`
@@ -643,21 +643,21 @@ $ ri --list --no-gems| wc -l
643
643
 
644
644
  #### Options `--home`, `--no-home`
645
645
 
646
- Option `--home` (the default) specifies that `ri` is to include source directory
646
+ Option `--home` (the default) specifies that `ri` is to include the source directory
647
647
  in `~/.rdoc` if it exists;
648
- option `--no-home` may be used to exclude them.
648
+ option `--no-home` may be used to exclude it.
649
649
 
650
650
  #### Options `--list-doc-dirs`, `--no-list-doc-dirs`
651
651
 
652
652
  Option `--list-doc-dirs` specifies that a list of the `ri` source directories
653
653
  is to be displayed;
654
- default is `--no-list-doc-dirs`.
654
+ the default is `--no-list-doc-dirs`.
655
655
 
656
656
  #### Option `--no-standard`
657
657
 
658
658
  Option `--no-standard` specifies that documents from the standard libraries
659
659
  are not to be included;
660
- default is to include documents from the standard libraries.
660
+ the default is to include documents from the standard libraries.
661
661
 
662
662
  #### Options `--site`, `--no-site`
663
663
 
@@ -680,7 +680,7 @@ specifies that `ri` is to enter interactive mode (ignoring the _name_ if given);
680
680
  the option is the default when no _name_ is given;
681
681
  option `--no-interactive` (the default)
682
682
  specifies that `ri` is not to enter interactive mode,
683
- regardless of whether _name_ is given.
683
+ regardless of whether a _name_ is given.
684
684
 
685
685
  ### Information Options
686
686
 
@@ -785,7 +785,7 @@ is not to be displayed.
785
785
 
786
786
  #### Options `--all`, `-a`, `--no-all`
787
787
 
788
- Option `--all` (aliased as `-a`) specifies that when _name_ identifies a class or module,
788
+ Option `--all` (aliased as `-a`) specifies that when a _name_ identifies a class or module,
789
789
  the documents for all its methods are included;
790
790
  option `--no-all` (the default) specifies that the method documents are not to be included:
791
791
 
@@ -809,16 +809,16 @@ the default port is `8214`.
809
809
  `ri` by default reads data from directories installed by Ruby and gems.
810
810
 
811
811
  You can create your own `ri` source files.
812
- This command creates `ri` source files in local directory `my_ri`,
813
- from Ruby source files in local directory `my_sources`:
812
+ This command creates `ri` source files in the local directory `my_ri`,
813
+ from Ruby source files in the local directory `my_sources`:
814
814
 
815
815
  ```sh
816
816
  $ rdoc --op my_ri --format=ri my_sources
817
817
  ```
818
818
 
819
819
  Those files may then be considered for any `ri` command
820
- by specifying option `--doc-dir=my_ri`;
821
- see [option \\--doc-dir][20].
820
+ by specifying the option `--doc-dir=my_ri`;
821
+ see [option `--doc-dir`][20].
822
822
 
823
823
  [1]: rdoc-ref:RI.md@Static+Mode
824
824
  [2]: rdoc-ref:RI.md@Interactive+Mode
@@ -828,7 +828,7 @@ see [option \\--doc-dir][20].
828
828
  [6]: rdoc-ref:RI.md@Page+Documents
829
829
  [7]: rdoc-ref:RI.md@ri+Lists
830
830
  [8]: rdoc-ref:RI.md@Options+--list-2C+-l-2C+--no-list
831
- [9]: https://docs.ruby-lang.org/en/master/IRB.html
831
+ [9]: https://ruby.github.io/irb/
832
832
  [10]: rdoc-ref:RI.md@Pager
833
833
  [11]: rdoc-ref:RI.md@Links+in+ri+Output
834
834
  [12]: rdoc-ref:RI.md@Options+--list-doc-dirs-2C+--no-list-doc-dirs
data/exe/rdoc CHANGED
@@ -25,11 +25,11 @@ rescue Errno::ENOSPC
25
25
  rescue SystemExit
26
26
  raise
27
27
  rescue Exception => e
28
- if $DEBUG_RDOC then
28
+ if $DEBUG_RDOC
29
29
  $stderr.puts e.message
30
30
  $stderr.puts "#{e.backtrace.join "\n\t"}"
31
31
  $stderr.puts
32
- elsif Interrupt === e then
32
+ elsif Interrupt === e
33
33
  $stderr.puts
34
34
  $stderr.puts 'Interrupted'
35
35
  else
@@ -1,98 +1,100 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Represent an alias, which is an old_name/new_name pair associated with a
4
- # particular context
5
- #--
6
- # TODO implement Alias as a proxy to a method/attribute, inheriting from
7
- # MethodAttr
2
+ module RDoc
3
+ ##
4
+ # Represent an alias, which is an old_name/new_name pair associated with a
5
+ # particular context
6
+ #--
7
+ # TODO implement Alias as a proxy to a method/attribute, inheriting from
8
+ # MethodAttr
8
9
 
9
- class RDoc::Alias < RDoc::CodeObject
10
+ class Alias < CodeObject
10
11
 
11
- ##
12
- # Aliased method's name
12
+ ##
13
+ # Aliased method's name
13
14
 
14
- attr_reader :new_name
15
+ attr_reader :new_name
15
16
 
16
- alias name new_name
17
+ alias name new_name
17
18
 
18
- ##
19
- # Aliasee method's name
19
+ ##
20
+ # Aliasee method's name
20
21
 
21
- attr_reader :old_name
22
+ attr_reader :old_name
22
23
 
23
- ##
24
- # Is this an alias declared in a singleton context?
24
+ ##
25
+ # Is this an alias declared in a singleton context?
25
26
 
26
- attr_reader :singleton
27
+ attr_reader :singleton
27
28
 
28
- ##
29
- # Creates a new Alias that aliases +old_name+
30
- # to +new_name+, has +comment+ and is a +singleton+ context.
29
+ ##
30
+ # Creates a new Alias that aliases +old_name+
31
+ # to +new_name+, has +comment+ and is a +singleton+ context.
31
32
 
32
- def initialize(old_name, new_name, comment, singleton: false)
33
- super()
33
+ def initialize(old_name, new_name, comment, singleton: false)
34
+ super()
34
35
 
35
- @singleton = singleton
36
- @old_name = old_name
37
- @new_name = new_name
38
- self.comment = comment
39
- end
36
+ @singleton = singleton
37
+ @old_name = old_name
38
+ @new_name = new_name
39
+ self.comment = comment
40
+ end
40
41
 
41
- ##
42
- # Order by #singleton then #new_name
42
+ ##
43
+ # Order by #singleton then #new_name
43
44
 
44
- def <=>(other)
45
- [@singleton ? 0 : 1, new_name] <=> [other.singleton ? 0 : 1, other.new_name]
46
- end
45
+ def <=>(other)
46
+ [@singleton ? 0 : 1, new_name] <=> [other.singleton ? 0 : 1, other.new_name]
47
+ end
47
48
 
48
- ##
49
- # HTML fragment reference for this alias
49
+ ##
50
+ # HTML fragment reference for this alias
50
51
 
51
- def aref
52
- type = singleton ? 'c' : 'i'
53
- "#alias-#{type}-#{html_name}"
54
- end
52
+ def aref
53
+ type = singleton ? 'c' : 'i'
54
+ "#alias-#{type}-#{html_name}"
55
+ end
55
56
 
56
- ##
57
- # HTML id-friendly version of +#new_name+.
57
+ ##
58
+ # HTML id-friendly version of +#new_name+.
58
59
 
59
- def html_name
60
- CGI.escape(@new_name.gsub('-', '-2D')).gsub('%', '-').sub(/^-/, '')
61
- end
60
+ def html_name
61
+ CGI.escape(@new_name.gsub('-', '-2D')).gsub('%', '-').sub(/^-/, '')
62
+ end
62
63
 
63
- def inspect # :nodoc:
64
- parent_name = parent ? parent.name : '(unknown)'
65
- "#<%s:0x%x %s.alias_method %s, %s>" % [
66
- self.class, object_id,
67
- parent_name, @old_name, @new_name,
68
- ]
69
- end
64
+ def inspect # :nodoc:
65
+ parent_name = parent ? parent.name : '(unknown)'
66
+ "#<%s:0x%x %s.alias_method %s, %s>" % [
67
+ self.class, object_id,
68
+ parent_name, @old_name, @new_name,
69
+ ]
70
+ end
70
71
 
71
- ##
72
- # '::' for the alias of a singleton method/attribute, '#' for instance-level.
72
+ ##
73
+ # '::' for the alias of a singleton method/attribute, '#' for instance-level.
73
74
 
74
- def name_prefix
75
- singleton ? '::' : '#'
76
- end
75
+ def name_prefix
76
+ singleton ? '::' : '#'
77
+ end
77
78
 
78
- ##
79
- # Old name with prefix '::' or '#'.
79
+ ##
80
+ # Old name with prefix '::' or '#'.
80
81
 
81
- def pretty_old_name
82
- "#{singleton ? '::' : '#'}#{@old_name}"
83
- end
82
+ def pretty_old_name
83
+ "#{singleton ? '::' : '#'}#{@old_name}"
84
+ end
84
85
 
85
- ##
86
- # New name with prefix '::' or '#'.
86
+ ##
87
+ # New name with prefix '::' or '#'.
87
88
 
88
- def pretty_new_name
89
- "#{singleton ? '::' : '#'}#{@new_name}"
90
- end
89
+ def pretty_new_name
90
+ "#{singleton ? '::' : '#'}#{@new_name}"
91
+ end
91
92
 
92
- alias pretty_name pretty_new_name
93
+ alias pretty_name pretty_new_name
93
94
 
94
- def to_s # :nodoc:
95
- "alias: #{self.new_name} -> #{self.pretty_old_name} in: #{parent}"
96
- end
95
+ def to_s # :nodoc:
96
+ "alias: #{self.new_name} -> #{self.pretty_old_name} in: #{parent}"
97
+ end
97
98
 
99
+ end
98
100
  end