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 +4 -4
- data/bin/rdoc_link_checker +16 -5
- data/config/ruby.json +10 -0
- data/doc/help.txt +29 -5
- data/lib/rdoc_link_checker/version.rb +5 -5
- data/lib/rdoc_link_checker.rb +716 -674
- metadata +4 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb872be04882f5f7d1766531b096683198244ac46f1997e896e65e7f79cb3f47
|
|
4
|
+
data.tar.gz: 47768288623da2a9bf3610c4404ef5bdf704098a6572daeecae5400ab7e81987
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 743c976e0ad98d6f624d3d7856504944ce82c0455a94fe693bf4b508eb9dada4b1c3f8d1d19211a8d9dbff96c6ff25e708ed1193afd8bc0cf036ca3eff614cc4
|
|
7
|
+
data.tar.gz: 7f670d5f69e16259d1f6eeb555f38a2631eb6e8b53be91ab5a5d7a78f33e5fff40533c4438fe6024c465ddd894f876759097a099020c5860cd9843285bfdf0a2
|
data/bin/rdoc_link_checker
CHANGED
|
@@ -4,11 +4,11 @@ require 'getoptlong'
|
|
|
4
4
|
require_relative '../lib/rdoc_link_checker'
|
|
5
5
|
|
|
6
6
|
options = GetoptLong.new(
|
|
7
|
-
['--
|
|
8
|
-
['--onsite_only',
|
|
9
|
-
['--no_toc',
|
|
10
|
-
['--version',
|
|
11
|
-
['--help',
|
|
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
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
|
-
--
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
--
|
|
14
|
-
--
|
|
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.
|
|
5
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RDocLinkChecker
|
|
4
|
+
VERSION = "0.7.0"
|
|
5
|
+
end
|