html-proofer 5.2.1 → 5.2.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: 9883d35b171b2912cb327e9360f7ff63fcecaaff8cafa44c04eb7ba38c2ea226
4
- data.tar.gz: '009a17164398c5bfd6456d6c0235e8606cd9bc98602ac392e11269e49574867e'
3
+ metadata.gz: 1081048f56ee5d0b41f5ba9278d0757d1a1eef6fdb8c50148eb2b47a183b5572
4
+ data.tar.gz: 9a60b977a473c77c12085062b0438eb175751a0a013206ec4dbd1baf03deffb6
5
5
  SHA512:
6
- metadata.gz: 02ba6094a5a0516d6452b72d898be194cc1c2ace2779e6c21b688116b2335dd55704c78ba614cac7d5aab56fa0557b18e82fb0c1d0f084954bc012de584f52e3
7
- data.tar.gz: 0cf8697a7bb36c0213ee62596323e21679d0bc679315aee33ab521bea8675f13d8a2adf3a9f8be7284fd488686629b9e18b2fbcbafc7b59b88d424daa063b50e
6
+ metadata.gz: 0402cc78e35cd4440bf95e9a9d0372f68677d28ad0e901867457c4583caebb4cbd4eefdc50e27e270d85e756ee402c0e2ba6898c3bf1b074fef6f69f8b30ae7a
7
+ data.tar.gz: f5754b9c79336f792cb2064baab958b7c27e62d13a6ae225a9fe5cde286d773e9427251ccd7b44afa7d258e517a5838af5ad6fdff3c63a0b6bf21b8cba08c75f
@@ -172,7 +172,9 @@ module HTMLProofer
172
172
  def unslashed_directory?(file)
173
173
  return false unless File.directory?(file)
174
174
 
175
- !file.end_with?(File::SEPARATOR) && !follow_location?
175
+ # the trailing slash must be read off the URL, not off `file`: the latter
176
+ # is produced by File.expand_path, which strips trailing separators
177
+ !path.to_s.end_with?("/") && !follow_location?
176
178
  end
177
179
 
178
180
  def follow_location?
@@ -239,7 +241,7 @@ module HTMLProofer
239
241
  else
240
242
  url
241
243
  end
242
- rescue Addressable::URI::InvalidURIError # rubocop:disable Lint/SuppressedException -- error will be reported at check time
244
+ rescue Addressable::URI::InvalidURIError # -- error will be reported at check time
243
245
  end
244
246
 
245
247
  private def swap_urls!
@@ -121,7 +121,10 @@ module HTMLProofer
121
121
  return false unless url.hash?
122
122
 
123
123
  hash = url.hash
124
- headers = response.options.fetch(:headers, {})
124
+ # `response.headers` covers both live responses (which expose the headers
125
+ # via :response_headers) and stubbed ones (which set :headers directly);
126
+ # reading options[:headers] saw nothing but stubs.
127
+ headers = response.headers || {}
125
128
  content_type = headers.find { |k, _| k.casecmp("content-type").zero? }
126
129
 
127
130
  # attempt to verify PDF hash ref; see #787 for more details
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTMLProofer
4
- VERSION = "5.2.1"
4
+ VERSION = "5.2.2"
5
5
  end
data/lib/html_proofer.rb CHANGED
@@ -18,7 +18,7 @@ if ENV.fetch("DEBUG", false)
18
18
  require "debug"
19
19
  begin
20
20
  require "amazing_print"
21
- rescue LoadError # rubocop:disable Lint/SuppressedException
21
+ rescue LoadError
22
22
  end
23
23
  end
24
24
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-proofer
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
@@ -135,48 +135,6 @@ dependencies:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
137
  version: '2.5'
138
- - !ruby/object:Gem::Dependency
139
- name: rspec
140
- requirement: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: '3.1'
145
- type: :development
146
- prerelease: false
147
- version_requirements: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - "~>"
150
- - !ruby/object:Gem::Version
151
- version: '3.1'
152
- - !ruby/object:Gem::Dependency
153
- name: timecop
154
- requirement: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - "~>"
157
- - !ruby/object:Gem::Version
158
- version: '0.8'
159
- type: :development
160
- prerelease: false
161
- version_requirements: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - "~>"
164
- - !ruby/object:Gem::Version
165
- version: '0.8'
166
- - !ruby/object:Gem::Dependency
167
- name: vcr
168
- requirement: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - "~>"
171
- - !ruby/object:Gem::Version
172
- version: '6.4'
173
- type: :development
174
- prerelease: false
175
- version_requirements: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - "~>"
178
- - !ruby/object:Gem::Version
179
- version: '6.4'
180
138
  description: Test your rendered HTML files to make sure they're accurate.
181
139
  email:
182
140
  - gjtorikian@gmail.com
@@ -234,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
192
  - !ruby/object:Gem::Version
235
193
  version: '0'
236
194
  requirements: []
237
- rubygems_version: 4.0.6
195
+ rubygems_version: 4.0.10
238
196
  specification_version: 4
239
197
  summary: A set of tests to validate your HTML output. These tests check if your image
240
198
  references are legitimate, if they have alt tags, if your internal links are working,