html-proofer 5.0.0 → 5.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: f2c984bfe049fba10c746d289d8d0256f219d6ae8f5af152f6f8af68e639301b
4
- data.tar.gz: c407f3995e873bbbc42d90de1f082827a40caa90cb12e5cdba7fd514500d1124
3
+ metadata.gz: 9ee4cb46fd2691b7c8ed80a1e11069fa8d9f4b0058e69ce00bd15da9fcf3b3b4
4
+ data.tar.gz: cfc205c660310bde3b5329079ee1de8aa4eb3083b95c691386ccc491ddca628c
5
5
  SHA512:
6
- metadata.gz: 732365ae4207754f70b27843a52d4f8186673fe1282ddaae03244ebff07517816371e970b75e465539bac51e931d51d4b1856866fcd6a3a575ae6e980d7c6465
7
- data.tar.gz: ab01a8425d206863584e6c84f395ab85a22eff9d2e1df0daa4e0f72771fc9bde95a8992da17d2ef8195439ad1de2412135758989bb9ba29766b1978d95e0fad4
6
+ metadata.gz: 567f404dec415cd1c21f04f6fe951cc217a3d918f8434ca1b6ec2b63d58efad89513408808626d82f7fc56f898c55a80d10560e8e36b1185c044e0b067833f4a
7
+ data.tar.gz: 21103cf7d04e277d886226a8e89f1720b346b353e6b8c838247a70d4360c6e1c596ea99bddb243e7dd3026febad085c5b7f163ee0a7617c127d8ad5d7237a325
@@ -134,7 +134,17 @@ module HTMLProofer
134
134
 
135
135
  section(opts, "Ignore Configuration") do
136
136
  set_option(opts, "--ignore-files [FILE1,FILE2,...]") do |long_opt_symbol, list|
137
- @options[long_opt_symbol] = list.nil? ? [] : list.split(",")
137
+ @options[long_opt_symbol] = if list.nil?
138
+ []
139
+ else
140
+ list.split(",").map.each do |l|
141
+ if l.start_with?("/") && l.end_with?("/")
142
+ Regexp.new(l[1...-1])
143
+ else
144
+ l
145
+ end
146
+ end
147
+ end
138
148
  end
139
149
 
140
150
  set_option(opts, "--[no-]ignore-empty-alt") do |long_opt_symbol, arg|
@@ -187,12 +197,12 @@ module HTMLProofer
187
197
  @options[long_opt_symbol] = parse_json_option("typhoeus", arg, symbolize_names: false)
188
198
  end
189
199
 
190
- set_option(opts, "--hydra <CONFIG>") do |long_opt_symbol, _list|
191
- @options[long_opt_symbol] = parse_json_option("hydra", arg, symbolize_names: false)
200
+ set_option(opts, "--hydra <CONFIG>") do |long_opt_symbol, arg|
201
+ @options[long_opt_symbol] = parse_json_option("hydra", arg, symbolize_names: true)
192
202
  end
193
203
 
194
- set_option(opts, "--cache <CONFIG>") do |long_opt_symbol, _list|
195
- @options[long_opt_symbol] = parse_json_option("cache", arg, symbolize_names: false)
204
+ set_option(opts, "--cache <CONFIG>") do |long_opt_symbol, arg|
205
+ @options[long_opt_symbol] = parse_json_option("cache", arg, symbolize_names: true)
196
206
  end
197
207
  end
198
208
 
@@ -285,7 +295,7 @@ module HTMLProofer
285
295
  check_internal_hash: ["Checks whether internal hashes exist (even if the webpage exists) (default: `true`)."],
286
296
  check_sri: ["Check that `<link>` and `<script>` external resources use SRI (default: `false`)."],
287
297
  disable_external: ["If `true`, does not run the external link checker (default: `false`)."],
288
- enforce_https: ["Fails a link if it\'s not marked as `https` (default: `true`)."],
298
+ enforce_https: ["Fails a link if it's not marked as `https` (default: `true`)."],
289
299
  root_dir: ["The absolute path to the directory serving your html-files."],
290
300
 
291
301
  ignore_empty_alt: ["If `true`, ignores images with empty/missing ",
@@ -166,8 +166,14 @@ module HTMLProofer
166
166
 
167
167
  def ignore_file?(file)
168
168
  @options[:ignore_files].each do |pattern|
169
- return true if pattern.is_a?(String) && pattern == file
170
- return true if pattern.is_a?(Regexp) && pattern =~ file
169
+ if pattern.is_a?(String) && pattern == file
170
+ @logger.log(:debug, "Ignoring #{file} because it matches #{pattern}")
171
+ return true
172
+ end
173
+ next unless pattern.is_a?(Regexp) && pattern.match(file)
174
+
175
+ @logger.log(:debug, "Ignoring #{file} because it matches regexp #{pattern}")
176
+ return true
171
177
  end
172
178
 
173
179
  false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTMLProofer
4
- VERSION = "5.0.0"
4
+ VERSION = "5.0.2"
5
5
  end
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.0
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-08 00:00:00.000000000 Z
11
+ date: 2022-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -288,7 +288,7 @@ licenses:
288
288
  metadata:
289
289
  funding_uri: https://github.com/sponsors/gjtorikian/
290
290
  rubygems_mfa_required: 'true'
291
- post_install_message:
291
+ post_install_message:
292
292
  rdoc_options: []
293
293
  require_paths:
294
294
  - lib
@@ -307,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
307
  version: '0'
308
308
  requirements: []
309
309
  rubygems_version: 3.3.7
310
- signing_key:
310
+ signing_key:
311
311
  specification_version: 4
312
312
  summary: A set of tests to validate your HTML output. These tests check if your image
313
313
  references are legitimate, if they have alt tags, if your internal links are working,