html-proofer 3.7.0 → 3.7.1

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
  SHA1:
3
- metadata.gz: 6849cc3fcff2f9484b194cbeb1e6a74c5ce569df
4
- data.tar.gz: a926c5b784dc04b8437b042b11fd96b9f2e0e822
3
+ metadata.gz: 2e2e987f27cea394b1d6fd60937e45e32addbd15
4
+ data.tar.gz: 894dba51116323f95f00720d9317c75e00be75fc
5
5
  SHA512:
6
- metadata.gz: bc5fb91918a157a54496abc4340f4731507a393aca4da5ce21f2afd42c83d49b7636d48777acabb1542e4854944aa0242c798605b3966fb5e55ee805648736d3
7
- data.tar.gz: 1d7b2107525185bcdc87647c958f71c00d0fa575665a852306de8f945fb18652ad467b76473d5255d1b11de5c101e164363984340385de47aee7cc5482a713ea
6
+ metadata.gz: 27cb87adf3a63d61e020d55418d2bb33983e1b50a709d3251caf5e66850ea694f812e51eaaff2ec08a3cdff081c6a2ad18fa6db402b90d36fa4507815c552274
7
+ data.tar.gz: 1a126cc3aabbd152d8afac93b3b1a4133498b95d6218aeb1885142623f324628dfd367f3b4919deeefb7ca093ab2d605f09273ed7089b5aac58a51321dcdb40b
@@ -29,11 +29,11 @@ class ScriptCheck < ::HTMLProofer::Check
29
29
  end
30
30
 
31
31
  def check_sri(line, content)
32
- if !defined? @script.integrity && !defined? @script.crossorigin
32
+ if !defined?(@script.integrity) && !defined?(@script.crossorigin)
33
33
  add_issue("SRI and CORS not provided in: #{@script.src}", line: line, content: content)
34
- elsif !defined? @script.integrity
34
+ elsif !defined?(@script.integrity)
35
35
  add_issue("Integrity is missing in: #{@script.src}", line: line, content: content)
36
- elsif !defined? @script.crossorigin
36
+ elsif !defined?(@script.crossorigin)
37
37
  add_issue("CORS not provided for external resource in: #{@script.src}", line: line, content: content)
38
38
  end
39
39
  end
@@ -16,7 +16,9 @@ module HTMLProofer
16
16
  instance_variable_set("@#{name}", value.value)
17
17
  end
18
18
 
19
- @aria_hidden = @aria_hidden == 'true' ? true : false
19
+ @aria_hidden = (defined?(@aria_hidden) && @aria_hidden == 'true') ? true : false
20
+
21
+ @data_proofer_ignore = defined?(@data_proofer_ignore)
20
22
 
21
23
  @text = obj.content
22
24
  @check = check
@@ -31,9 +33,23 @@ module HTMLProofer
31
33
  @parent_ignorable = parent_attributes.any? { |a| !a['data-proofer-ignore'].nil? }
32
34
 
33
35
  # fix up missing protocols
34
- @href.insert 0, 'http:' if @href =~ %r{^//}
35
- @src.insert 0, 'http:' if @src =~ %r{^//}
36
- @srcset.insert 0, 'http:' if @srcset =~ %r{^//}
36
+ if defined?(@href)
37
+ @href.insert(0, 'http:') if @href =~ %r{^//}
38
+ else
39
+ @href = nil
40
+ end
41
+
42
+ if defined?(@src)
43
+ @src.insert(0, 'http:') if @src =~ %r{^//}
44
+ else
45
+ @src = nil
46
+ end
47
+
48
+ if defined?(@srcset)
49
+ @srcset.insert(0, 'http:') if @srcset =~ %r{^//}
50
+ else
51
+ @srcset = nil
52
+ end
37
53
  end
38
54
 
39
55
  def url
@@ -50,7 +66,7 @@ module HTMLProofer
50
66
 
51
67
  def parts
52
68
  @parts ||= Addressable::URI.parse url
53
- rescue URI::Error, Addressable::URI::InvalidURIError => e
69
+ rescue URI::Error, Addressable::URI::InvalidURIError
54
70
  @parts = nil
55
71
  end
56
72
 
@@ -142,7 +142,7 @@ module HTMLProofer
142
142
  end
143
143
 
144
144
  def checks
145
- return @checks unless @checks.nil?
145
+ return @checks if defined?(@checks) && !@checks.nil?
146
146
  @checks = HTMLProofer::Check.subchecks.map(&:name)
147
147
  @checks.delete('FaviconCheck') unless @options[:check_favicon]
148
148
  @checks.delete('HtmlCheck') unless @options[:check_html]
@@ -1,3 +1,3 @@
1
1
  module HTMLProofer
2
- VERSION = '3.7.0'.freeze
2
+ VERSION = '3.7.1'.freeze
3
3
  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.7.0
4
+ version: 3.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-20 00:00:00.000000000 Z
11
+ date: 2017-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary