webri 1.0.1 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4bc8110feecac22d65e1e47e5fda7dc5315ea7dd4f1d4ab67c62d30af6bb8cb
4
- data.tar.gz: 9574bb0c08d78ffd32a6627d0c19ecf0f81e7f7ba0303d64c0b6e92e93f2395f
3
+ metadata.gz: 6217b650dbad69d9d6f446e5d7c5e615042ee5ca56d85fa98866d5c31fb332c6
4
+ data.tar.gz: b0b4bd81d6f463d1a5df7d39b30b21c6cedd2d082e8a14239ee1d6c54dcdf91b
5
5
  SHA512:
6
- metadata.gz: c7b52fa6deb5b9b2029d70ff7ea2b226b2734aa39a2cd6aeb8dce1e7ee2f3e6a687321997beea7b9d958a11cf3b8017d149bcd8dee82a5a98e645619be50db48
7
- data.tar.gz: 1942e35d5aca012c2c8843cdf222502e787226ee5834b10d88409d0a4ccde8178c874a79a52d38c0bf36325a01ca5dcfec4ff6188360493ba2d2f3b5cd42e9f6
6
+ metadata.gz: e66e895a9eea4695324e69ebf425b193e0e3774cb0390f8e4bfc2953af824eee9e68ad4b3cd8a5361dea6898a3cd81a9bdc2dc70012bd43429de8dc01b9d59fb
7
+ data.tar.gz: b5eec14697ef1d868d6285b8004969d3a770da7a3c807030c91a57ffe3b13277801b859f2e7eb1843f552f50f36d55c783d6c43abc200d6c8c844ce90994bf6d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
- ## [Unreleased]
1
+ ## Releases
2
2
 
3
- ## [0.1.0] - 2024-11-28
3
+ ## [1.0.1] - 2025-06-13
4
4
 
5
5
  - Initial release
6
+
7
+ ## [1.0.2] - 2025-06-14
8
+
9
+ - Clarify concept: Ruby page (not Ruby file).
data/README.md CHANGED
@@ -14,7 +14,7 @@ WebRI displays documentation for:
14
14
 
15
15
  - A **class** or **module**: opens its web page.
16
16
  - A **method**: opens the web page for its class/module _scrolled to the method's documentation_.
17
- - A Ruby **file**: opens a free-standing web page.
17
+ - A Ruby **page**: opens a free-standing web page.
18
18
 
19
19
  ## Usage
20
20
 
@@ -43,7 +43,7 @@ At the prompt, you can type:
43
43
  - The name of a [class or module][1].
44
44
  - The name of a [singleton method][2].
45
45
  - The name of an [instance method][3].
46
- - The name of a [Ruby file][4].
46
+ - The name of a [Ruby page][4].
47
47
  - An abbreviation of any of the above.
48
48
  - One of the [special names][5] `@help` or `@readme`.
49
49
 
@@ -196,19 +196,19 @@ Found no instance method name starting with '#nosuch'.
196
196
  Show names of all 10370 instance methods? (y or n): n
197
197
  ```
198
198
 
199
- ### Ruby 'File'
199
+ ### Ruby Page
200
200
 
201
201
  For a name beginning with `ruby:`,
202
- finds the names of ruby files beginning
202
+ finds the names of ruby pages beginning
203
203
  with that name.
204
204
 
205
- When exactly one such file name is found:
205
+ When exactly one such page name is found:
206
206
 
207
207
  - If the name is the exact name of the found name, opens its page:
208
208
 
209
209
  ```
210
210
  webri> ruby:operators
211
- Found one file name starting with 'operators'
211
+ Found one page name starting with 'operators'
212
212
  operators (syntax/operators_rdoc.html)
213
213
  ```
214
214
 
@@ -216,18 +216,18 @@ Found one file name starting with 'operators'
216
216
 
217
217
  ```
218
218
  webri> ruby:opera
219
- Found one file name starting with 'opera'
219
+ Found one page name starting with 'opera'
220
220
  operators (syntax/operators_rdoc.html)
221
221
  Open page syntax/operators_rdoc.html? (y or n): y
222
222
  Opening web page https://docs.ruby-lang.org/en/3.4/syntax/operators_rdoc.html.
223
223
 
224
224
  ```
225
225
 
226
- When multiple such file names are found offer to list the found names:
226
+ When multiple such page names are found offer to list the found names:
227
227
 
228
228
  ```
229
229
  webri> ruby:o
230
- Found 4 file names starting with 'o'.
230
+ Found 4 page names starting with 'o'.
231
231
  Show 4 names?' (y or n): y
232
232
  0: operators (syntax/operators_rdoc.html)
233
233
  1: option_dump (ruby/option_dump_md.html)
@@ -237,12 +237,12 @@ Type a number to choose, or Return to skip: 2
237
237
 
238
238
  ```
239
239
 
240
- When no such file name is found, offers to list all file names:
240
+ When no such page name is found, offers to list all page names:
241
241
 
242
242
  ```
243
243
  webri> ruby:nosuch
244
- Found no file name starting with 'nosuch'.
245
- Show names of all 83 files? (y or n): y
244
+ Found no page name starting with 'nosuch'.
245
+ Show names of all 83 pages? (y or n): y
246
246
  0: COPYING (COPYING.html)
247
247
  1: COPYING.ja (COPYING_ja.html)
248
248
  2: LEGAL (LEGAL.html)
@@ -374,7 +374,7 @@ Names:
374
374
  1364 class names
375
375
  1175 singleton_method names
376
376
  4407 instance_method names
377
- 81 file names
377
+ 81 page names
378
378
  ```
379
379
 
380
380
  Option `--release` sets the release of the documentation to be used.
@@ -389,7 +389,7 @@ Names:
389
389
  1262 class names
390
390
  1301 singleton_method names
391
391
  4397 instance_method names
392
- 73 file names
392
+ 73 page names
393
393
  $ webri --release=3.3 --info
394
394
  Ruby documentation release: '3.3'
395
395
  Ruby documentation URL: 'https://docs.ruby-lang.org/en/3.3/table_of_contents.html'
@@ -398,7 +398,7 @@ Names:
398
398
  1469 class names
399
399
  1270 singleton_method names
400
400
  4638 instance_method names
401
- 77 file names
401
+ 77 page names
402
402
  ```
403
403
 
404
404
  Issues a message if the given release is unknown:
@@ -452,5 +452,5 @@ to follow the [code of conduct](https://github.com/BurdetteLamar/webri/blob/mast
452
452
  [1]: rdoc-ref:README.md@Class+or+Module
453
453
  [2]: rdoc-ref:README.md@Singleton+Method
454
454
  [3]: rdoc-ref:README.md@Instance+Method
455
- [4]: rdoc-ref:README.md@Ruby+File
455
+ [4]: rdoc-ref:README.md@Ruby+Page
456
456
  [5]: rdoc-ref:README.md@Special+Names
data/lib/webri/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class WebRI
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
data/lib/webri.rb CHANGED
@@ -10,12 +10,9 @@ require 'cgi'
10
10
  # TODO: Subroutinize.
11
11
  # TODO: Make initialization faster.
12
12
 
13
- # TODO: Build test names from ruby-lang.org (not webri).
14
- #
15
13
  # TODO: Choose dynamically the test names (rather than fixed)?
16
- # TODO: Test methods with trailing special chars, and with all special chars
17
14
  # TODO: Test on Linux.
18
- # TODO: Test all releases.
15
+ # TODO: Test all releases(?).
19
16
  # TODO: Test all pages(?).
20
17
 
21
18
  # TODO: Make it work for naked method ('parse') or dotted method ('.parse').
@@ -104,7 +101,7 @@ class WebRI
104
101
  class: {}, # Has both classes and modules.
105
102
  singleton_method: {},
106
103
  instance_method: {},
107
- file: {},
104
+ page: {},
108
105
  }
109
106
  # Iterate over the lines of the TOC page.
110
107
  lines = @toc_html.split("\n")
@@ -139,7 +136,7 @@ class WebRI
139
136
  end
140
137
  entry.paths.push(path) unless entry.paths.include?(path)
141
138
  when 'file'
142
- index = @index_for_type[:file]
139
+ index = @index_for_type[:page]
143
140
  if index.include?(full_name)
144
141
  entry = index[full_name]
145
142
  else
@@ -277,7 +274,7 @@ class WebRI
277
274
  when %w[fatal fata fat fa f].include?(name)
278
275
  show_class(name, @index_for_type[:class])
279
276
  when name.start_with?('ruby:')
280
- show_file(name, @index_for_type[:file])
277
+ show_file(name, @index_for_type[:page])
281
278
  when name.start_with?('::')
282
279
  show_singleton_method(name, @index_for_type[:singleton_method])
283
280
  when name.start_with?('#')
@@ -342,11 +339,11 @@ class WebRI
342
339
  open_page(name, uri)
343
340
  end
344
341
 
345
- # Show file.
342
+ # Show page.
346
343
  def show_file(name, file_index)
347
344
  # Target page is a free-standing page such as 'COPYING'.
348
345
  name = name.sub(/^ruby:/, '') # Discard leading 'ruby:'
349
- all_entries = @index_for_type[:file]
346
+ all_entries = @index_for_type[:page]
350
347
  all_choices = FileEntry.choices(all_entries)
351
348
  # Find entries whose names that start with name.
352
349
  selected_entries = all_entries.select do |key, value|
@@ -364,7 +361,7 @@ class WebRI
364
361
  selected_choices = FileEntry.choices(selected_entries)
365
362
  choice = selected_choices.keys.first
366
363
  path = selected_choices.values.first
367
- puts "Found one file name starting with '#{name}'\n #{choice}"
364
+ puts "Found one page name starting with '#{name}'\n #{choice}"
368
365
  full_name = FileEntry.full_name_for_choice(choice)
369
366
  if name != full_name
370
367
  message = "Open page #{path}?"
@@ -372,15 +369,15 @@ class WebRI
372
369
  end
373
370
  path
374
371
  when 0
375
- puts "Found no file name starting with '#{name}'."
376
- message = "Show names of all #{all_choices.size} files?"
372
+ puts "Found no page name starting with '#{name}'."
373
+ message = "Show names of all #{all_choices.size} pages?"
377
374
  return unless get_boolean_answer(message)
378
375
  key = get_choice(all_choices.keys)
379
376
  return if key.nil?
380
377
  path = all_choices[key]
381
378
  else
382
379
  selected_choices = FileEntry.choices(selected_entries)
383
- puts "Found #{selected_choices.size} file names starting with '#{name}'."
380
+ puts "Found #{selected_choices.size} page names starting with '#{name}'."
384
381
  message = "Show #{selected_choices.size} names?'"
385
382
  return unless get_boolean_answer(message)
386
383
  key = get_choice(selected_choices.keys)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - BurdetteLamar
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-06-13 00:00:00.000000000 Z
10
+ date: 2025-06-14 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Command-line utility for displaying Ruby online documentation
13
13
  email: