html-proofer 4.0.0.rc1 → 4.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bec55c40cc2d01b65496b138570cf434e533d045476470e4ce1e6b0daf3d5408
4
- data.tar.gz: dd77aaf59adf3eaaa48a6b20dab59adbb0a5974b0a4ded5f9fd51e1fc9ba3684
3
+ metadata.gz: fe365dbadbbe912ceb224355c844dbca64a07af97827b4c8ee43cf5a47c24c2f
4
+ data.tar.gz: 63b5df6a997e887dde145aaaabc2db988d2d28751ab91a8f9040e82676307779
5
5
  SHA512:
6
- metadata.gz: 5036e6f46c4e0ac32bd9a6f4bd891244f25cb43670c40eee7c7421c661f9a3b6e24edd15507b6290fd102f37988529250cecf5800b63b6ed1f8622dd983c76ec
7
- data.tar.gz: cb9fdec8ec8774e8a9607d9b92b859767b6726e45b0bc54d6b1eee993de03c1a0a81a50035fe32543e96a7f1ee1d420366076d1d5956761abd1201086e35f057
6
+ metadata.gz: 5cf2b0c74896ecfc85fc98a67a6eac648de0bfe90ba0c08564031b9ee5b613237219b970e8c6f71901a300f7c14354755dc4f3878918b92c8029841795c72e01
7
+ data.tar.gz: b26a375b4f245b1c0edc27c5291ca86b2f738ac5a55b5fa7a64f1f148e763b5bd8961168dad9cf50bb91c4287e7bb6a2d25cdd26eac2b06b31551777984eb1ff
@@ -95,8 +95,6 @@ module HTMLProofer
95
95
  # prepare to add new URLs detected
96
96
  private def determine_additions(urls_detected, type)
97
97
  additions = urls_detected.reject do |url, metadata|
98
- url = cleaned_url(url)
99
-
100
98
  if @cache_log[type].include?(url)
101
99
  @cache_log[type][url][:metadata] = metadata
102
100
 
@@ -124,8 +122,6 @@ module HTMLProofer
124
122
  deletions = 0
125
123
 
126
124
  @cache_log[type].delete_if do |url, _|
127
- url = cleaned_url(url)
128
-
129
125
  if urls_detected.include?(url)
130
126
  false
131
127
  elsif url_matches_type?(url, type)
@@ -149,6 +145,10 @@ module HTMLProofer
149
145
  # if there are no urls, bail
150
146
  return {} if urls_detected.empty?
151
147
 
148
+ urls_detected = urls_detected.transform_keys do |url|
149
+ cleaned_url(url)
150
+ end
151
+
152
152
  urls_to_check = detect_url_changes(urls_detected, type)
153
153
 
154
154
  @cache_log[type].each_pair do |url, cache|
@@ -222,9 +222,11 @@ module HTMLProofer
222
222
  end
223
223
 
224
224
  private def cleaned_url(url)
225
- return escape_unescape(url) unless url.end_with?('/', '#', '?') && url.length > 1
225
+ cleaned_url = escape_unescape(url)
226
+
227
+ return cleaned_url unless cleaned_url.end_with?('/', '#', '?') && cleaned_url.length > 1
226
228
 
227
- escape_unescape(url[0..-2])
229
+ cleaned_url[0..-2]
228
230
  end
229
231
 
230
232
  private def escape_unescape(url)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTMLProofer
4
- VERSION = '4.0.0.rc1'
4
+ VERSION = '4.0.0.rc2'
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: 4.0.0.rc1
4
+ version: 4.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-05 00:00:00.000000000 Z
11
+ date: 2022-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -136,20 +136,6 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: debug
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: rake
155
141
  requirement: !ruby/object:Gem::Requirement