html-proofer 3.17.1 → 3.17.2

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: f8be1f60d1495959b468c2cfad3a4d659a5817b934bb2011906540d296e2a062
4
- data.tar.gz: 39ecb6a6899913c4745289443ff77cf1483d3578689fc616099bb00df90a4f16
3
+ metadata.gz: ee53fc4edb91d7319f27f79abf9c31a10761b19fdbabf25904048fd4a1f3f2b5
4
+ data.tar.gz: a779feb72397f9f7b3498702ba6097437ca4162fe95e9c618df2c32df317196f
5
5
  SHA512:
6
- metadata.gz: ce1749adb1022b2a3245396c28b990d4de6bfe368fb5944cddf81b48822f54dff8c744b847e65bcd4cb040f2e7f63a1cbdcccebda943380ab767ecbd96161c8a
7
- data.tar.gz: 0ffc3e5095dbf40272113991b521a0909408a40715efb2119bfd8f4a310b62b6884fe2566beb198e873f781d6d0ebefed06a966a91a4772309c53835c66ce483
6
+ metadata.gz: 1caec4616e73928e36e32cedc4529b0ad4628d5ff22b0b060f14d967f9e778fbad9cfdc1b3cc22aa302ea9e7509eb3d7bbaffeacc7f95541cede0bb1c875a3fa
7
+ data.tar.gz: e33a43f7e5fcbe892acf02c89950715d5b34e2d11430507ab83574126e9568a32a57a238727fa047153d7f4824baba9d62dbf2839655fd49c28ac50bb1469eea
@@ -181,7 +181,8 @@ module HTMLProofer
181
181
  path_dot_ext = path + @check.options[:extension] if @check.options[:assume_extension]
182
182
 
183
183
  base = if absolute_path?(path) # path relative to root
184
- @check.options[:root_dir] || File.dirname(@check.src)
184
+ # either overwrite with root_dir; or, if source is directory, use that; or, just get the current file's dirname
185
+ @check.options[:root_dir] || (File.directory?(@check.src) ? @check.src : File.dirname(@check.src))
185
186
  elsif File.exist?(File.expand_path(path, @check.src)) || File.exist?(File.expand_path(path_dot_ext, @check.src)) # relative links, path is a file
186
187
  File.dirname(@check.path)
187
188
  elsif File.exist?(File.join(File.dirname(@check.path), path)) || File.exist?(File.join(File.dirname(@check.path), path_dot_ext)) # rubocop:disable Lint/DuplicateBranch; relative links in nested dir, path is a file
@@ -189,7 +190,9 @@ module HTMLProofer
189
190
  else # relative link, path is a directory
190
191
  @check.path
191
192
  end
193
+
192
194
  file = File.join(base, path)
195
+
193
196
  if @check.options[:assume_extension] && File.file?("#{file}#{@check.options[:extension]}")
194
197
  file = "#{file}#{@check.options[:extension]}"
195
198
  elsif File.directory?(file) && !unslashed_directory?(file) # implicit index support
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTMLProofer
4
- VERSION = '3.17.1'
4
+ VERSION = '3.17.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: 3.17.1
4
+ version: 3.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-22 00:00:00.000000000 Z
11
+ date: 2020-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable