rdoc_link_checker 0.6.0 → 0.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77d49154c855b923e70e92faf6e9206627a1e1793d3f93e9a6bf24c137c203f5
4
- data.tar.gz: c93421e52ad4f531ba57ab1cfd47e4996016621ec7f281b30a50ca4c76136c23
3
+ metadata.gz: eb872be04882f5f7d1766531b096683198244ac46f1997e896e65e7f79cb3f47
4
+ data.tar.gz: 47768288623da2a9bf3610c4404ef5bdf704098a6572daeecae5400ab7e81987
5
5
  SHA512:
6
- metadata.gz: f7e745ab474bec8a54e49ffc259a3f91a58231166f8c723c352e2235dba33fe1ef2db56b9f918d784b0f0caca6a145aacad5b669cd3c49b3d90fd6179684d2ff
7
- data.tar.gz: da062b580efb28b8fce02ab8b30f58270b4e08aabeab86a8441b7de68cd172a5fe13aa59274d6da2219e35cfd1bc0817308237f71d570db144a0a5ccb892e3f7
6
+ metadata.gz: 743c976e0ad98d6f624d3d7856504944ce82c0455a94fe693bf4b508eb9dada4b1c3f8d1d19211a8d9dbff96c6ff25e708ed1193afd8bc0cf036ca3eff614cc4
7
+ data.tar.gz: 7f670d5f69e16259d1f6eeb555f38a2631eb6e8b53be91ab5a5d7a78f33e5fff40533c4438fe6024c465ddd894f876759097a099020c5860cd9843285bfdf0a2
@@ -4,11 +4,11 @@ require 'getoptlong'
4
4
  require_relative '../lib/rdoc_link_checker'
5
5
 
6
6
  options = GetoptLong.new(
7
- ['--html_dirpath', '-d', GetoptLong::REQUIRED_ARGUMENT],
8
- ['--onsite_only', '-l', GetoptLong::NO_ARGUMENT],
9
- ['--no_toc', '-n', GetoptLong::NO_ARGUMENT],
10
- ['--version', '-v', GetoptLong::NO_ARGUMENT],
11
- ['--help', '-h', GetoptLong::NO_ARGUMENT]
7
+ ['--config', GetoptLong::REQUIRED_ARGUMENT],
8
+ ['--onsite_only', GetoptLong::NO_ARGUMENT],
9
+ ['--no_toc', GetoptLong::NO_ARGUMENT],
10
+ ['--version', GetoptLong::NO_ARGUMENT],
11
+ ['--help', GetoptLong::NO_ARGUMENT]
12
12
  )
13
13
 
14
14
  def help
@@ -16,6 +16,10 @@ def help
16
16
  dirname = File.dirname(File.dirname(path))
17
17
  filepath = File.join(dirname, 'doc', 'help.txt')
18
18
  puts File.read(filepath)
19
+ filepath = File.join(dirname, 'config', 'ruby.json')
20
+ File.readlines(filepath).each do |line|
21
+ puts " #{line}"
22
+ end
19
23
  exit
20
24
  end
21
25
 
@@ -24,10 +28,16 @@ def version
24
28
  exit
25
29
  end
26
30
 
31
+ config_filepath = nil
27
32
  onsite_only = false
28
33
  no_toc = false
29
34
  options.each do |option, argument|
30
35
  case option
36
+ when '--config'
37
+ config_filepath = argument
38
+ onsite_only = false
39
+ no_toc = false
40
+ break
31
41
  when '--onsite_only'
32
42
  onsite_only = true
33
43
  when '--no_toc'
@@ -53,6 +63,7 @@ raise ArgumentError.new(message) if message
53
63
  html_dirpath = ARGV[0]
54
64
  RDocLinkChecker.new(
55
65
  html_dirpath,
66
+ config_filepath: config_filepath,
56
67
  onsite_only: onsite_only,
57
68
  no_toc: no_toc
58
69
  ).check
data/config/ruby.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "options": {
3
+ "onsite_only": false,
4
+ "no_toc": true
5
+ },
6
+ "source_file_omits": [
7
+ "^LEGAL",
8
+ "^NEWS"
9
+ ]
10
+ }
data/doc/help.txt CHANGED
@@ -7,10 +7,34 @@ of RDoc-generated HTML files, such as those generated by command
7
7
  rdoc --visibility=private --op html . # Note the trailing dot.
8
8
 
9
9
  Options:
10
- --onsite_only Check link targets only on pages in the file tree at <html_dirpath>,
11
- and not those on other local pages or those on the web.
12
- --no_toc Do not check links on the TOC page (table_of_contents.html).
13
- --version Print the version and exit.
14
- --help Print this help and exit.
10
+ --config filepath Read configuration from file. See below.
11
+ --onsite_only Check link targets only on pages in the file tree at <html_dirpath>,
12
+ and not those on other local pages or those on the web.
13
+ --no_toc Do not check links on the TOC page (table_of_contents.html).
14
+ --version Print the version and exit.
15
+ --help Print this help and exit.
15
16
 
16
17
  The output is file <html_dirpath>/Report.htm, which reports broken links.
18
+
19
+ The configuration file must be a JSON object
20
+ (see https://docs.ruby-lang.org/en/master/JSON.html)
21
+ consisting of name/value pairs;
22
+ the names may include:
23
+
24
+ - "options": a JSON object consisting of option-name/value pairs;
25
+ the option-names may include:
26
+
27
+ - "onsite_only": the value must be true or false (not quoted),
28
+ which sets the onsite_only value.
29
+ - "no_toc": the value must be true or false (not quoted),
30
+ which sets the no_toc value.
31
+
32
+ - "source_file_omits": a JSON array consisting of double-quoted strings,
33
+ each of which will be used to create a Regexp object;
34
+ a source filepath that matches any of those regexps will not be checked
35
+ for bad links.
36
+
37
+ Example:
38
+
39
+
40
+
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- class RDocLinkChecker
4
- VERSION = "0.6.0"
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ class RDocLinkChecker
4
+ VERSION = "0.7.0"
5
+ end