html-proofer 5.0.10 → 5.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.
- checksums.yaml +4 -4
- data/lib/html_proofer/attribute/url.rb +3 -2
- data/lib/html_proofer/cache.rb +2 -2
- data/lib/html_proofer/configuration.rb +12 -1
- data/lib/html_proofer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fd5f97da4b4c9537822e31a821d41bcb04ea8eff97a5331d297ecb898ccd0630
|
|
4
|
+
data.tar.gz: 8d3df0b4bb5812e5aaa20907314bceef819134f56f55ad081776edc96e5406a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c65b869c013635c247c7235b3680d6c2ab99cc99c39eff43140a6ff8884f63bf70f3c625042d0a2124cf0e7b7bd36053c240cd1101ca768089657bb8b4fc17d
|
|
7
|
+
data.tar.gz: 239211f870b13baeb8c3f337005158c055c1dd53f5513092243c2d8548b5105e974a0472db85fc93e97bf91a83ad10c36d505ad778a5395030651a6e8a5d9199
|
|
@@ -133,8 +133,9 @@ module HTMLProofer
|
|
|
133
133
|
path_with_extension # existence checked implicitly by File.file?
|
|
134
134
|
# implicit index support
|
|
135
135
|
elsif File.directory?(path_to_resolve) && !unslashed_directory?(path_to_resolve)
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
@runner.options[:directory_index_files]
|
|
137
|
+
.map { |dif| File.join(path_to_resolve, dif) }
|
|
138
|
+
.find { |path_with_index| File.file?(path_with_index) }
|
|
138
139
|
# explicit file or directory
|
|
139
140
|
elsif File.exist?(path_to_resolve)
|
|
140
141
|
path_to_resolve
|
data/lib/html_proofer/cache.rb
CHANGED
|
@@ -34,9 +34,9 @@ module HTMLProofer
|
|
|
34
34
|
setup_cache!(options)
|
|
35
35
|
|
|
36
36
|
@external_timeframe = parsed_timeframe(options[:timeframe][:external])
|
|
37
|
-
define_singleton_method(:external_enabled?) { !@external_timeframe.nil? }
|
|
37
|
+
define_singleton_method(:external_enabled?) { !@external_timeframe.nil? } # rubocop:disable ThreadSafety/ClassInstanceVariable
|
|
38
38
|
@internal_timeframe = parsed_timeframe(options[:timeframe][:internal])
|
|
39
|
-
define_singleton_method(:internal_enabled?) { !@internal_timeframe.nil? }
|
|
39
|
+
define_singleton_method(:internal_enabled?) { !@internal_timeframe.nil? } # rubocop:disable ThreadSafety/ClassInstanceVariable
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
|
|
@@ -13,7 +13,7 @@ module HTMLProofer
|
|
|
13
13
|
check_external_hash: true,
|
|
14
14
|
check_internal_hash: true,
|
|
15
15
|
checks: DEFAULT_TESTS,
|
|
16
|
-
|
|
16
|
+
directory_index_files: ["index.html"],
|
|
17
17
|
disable_external: false,
|
|
18
18
|
ignore_empty_alt: true,
|
|
19
19
|
ignore_empty_mailto: false,
|
|
@@ -47,6 +47,12 @@ module HTMLProofer
|
|
|
47
47
|
|
|
48
48
|
class << self
|
|
49
49
|
def generate_defaults(opts)
|
|
50
|
+
# If `:directory_index_file` (singular) is given, convert it into an
|
|
51
|
+
# array for `:directory_index_files` (plural) instead.
|
|
52
|
+
if opts.key?(:directory_index_file)
|
|
53
|
+
opts[:directory_index_files] = [opts.delete(:directory_index_file)]
|
|
54
|
+
end
|
|
55
|
+
|
|
50
56
|
options = PROOFER_DEFAULTS.merge(opts)
|
|
51
57
|
|
|
52
58
|
options[:typhoeus] = HTMLProofer::Configuration::TYPHOEUS_DEFAULTS.merge(opts[:typhoeus] || {})
|
|
@@ -89,6 +95,10 @@ module HTMLProofer
|
|
|
89
95
|
@options[long_opt_symbol] = arg
|
|
90
96
|
end
|
|
91
97
|
|
|
98
|
+
set_option(opts, "--directory-index-files [FILENAME1,FILENAME2,...]") do |long_opt_symbol, list|
|
|
99
|
+
@options[long_opt_symbol] = list.nil? ? [] : list.split(",")
|
|
100
|
+
end
|
|
101
|
+
|
|
92
102
|
set_option(opts, "--extensions [EXT1,EXT2,...]") do |long_opt_symbol, list|
|
|
93
103
|
@options[long_opt_symbol] = list.nil? ? [] : list.split(",")
|
|
94
104
|
end
|
|
@@ -285,6 +295,7 @@ module HTMLProofer
|
|
|
285
295
|
"to allow extensionless URLs (as supported by most servers) (default: `.html`).",
|
|
286
296
|
],
|
|
287
297
|
directory_index_file: ["Sets the file to look for when a link refers to a directory. (default: `index.html`)."],
|
|
298
|
+
directory_index_files: ["Sets the files to look for when a link refers to a directory. (default: `[\"index.html\"]`)."],
|
|
288
299
|
extensions: [
|
|
289
300
|
"A comma-separated list of Strings indicating the file extensions you",
|
|
290
301
|
"would like to check (default: `.html`)",
|
data/lib/html_proofer/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: html-proofer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.0
|
|
4
|
+
version: 5.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Garen Torikian
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: addressable
|