html-proofer 3.11.1 → 3.12.0

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: bef0ae04093136fdf08e67fa972450c1c1ce356ded9c27d8a2b20bf5e231210c
4
- data.tar.gz: 5f7992911919eef31a7a186df3bfaa765191eed49692da6639d3d4c049fa1904
3
+ metadata.gz: a537508d8fd48a9ff72b2fcaa670e060228947772948ad13e2af35207d299fb4
4
+ data.tar.gz: 86f13c7b403a1f2ba9ae2394da32bf2a625d88784be14d4bdfc1467509b936b8
5
5
  SHA512:
6
- metadata.gz: 39b391bbb48b61e576a61a32199ac74fb362bc285fef8897438aa9d30b95c8cc62c71c9ca576b8b7e67e3a9543bd152d2f0d172ae56e64f5026bd1764ae499c9
7
- data.tar.gz: a1371937ce6c4433ce957f3e1d51b2e0b91ecb5284f2538ba7c9731e106b18d5c4ef4bb2a05e92b842477b55bbdc6e581a15851dd62817f63d8b3b56834bbe39
6
+ metadata.gz: 279f41c4472ddeb829cde63ba2497fe88dfdc52298bda5098b79b813a3710abdcf6a62b6d879c367724394d129685b9463ae1eab610e9b569fb0dbb76ed8da21
7
+ data.tar.gz: 48e32a23f8e94952c55659bb080b2dadcd5ff550a92b9733bd8b8a5707f6dda66362b854b5e088da644a1f297b1c0da54336b22f010f8aeb22b28fb8c6ecc5e9
@@ -3,9 +3,7 @@
3
3
  require_relative 'utils'
4
4
 
5
5
  require 'json'
6
- require 'active_support/core_ext/string'
7
- require 'active_support/core_ext/date'
8
- require 'active_support/core_ext/numeric/time'
6
+ require 'timerizer'
9
7
 
10
8
  module HTMLProofer
11
9
  class Cache
@@ -32,7 +30,7 @@ module HTMLProofer
32
30
  end
33
31
 
34
32
  def within_timeframe?(time)
35
- (@parsed_timeframe..@cache_time).cover?(time)
33
+ (@parsed_timeframe..@cache_time).cover?(Time.parse(time))
36
34
  end
37
35
 
38
36
  def urls
@@ -45,7 +43,7 @@ module HTMLProofer
45
43
 
46
44
  def parsed_timeframe(timeframe)
47
45
  time, date = timeframe.match(/(\d+)(\D)/).captures
48
- time = time.to_f
46
+ time = time.to_i
49
47
  case date
50
48
  when 'M'
51
49
  time.months.ago
@@ -21,7 +21,7 @@ class FaviconCheck < ::HTMLProofer::Check
21
21
 
22
22
  def is_immediate_redirect?
23
23
  # allow any instant-redirect meta tag
24
- @html.xpath("//meta[@http-equiv='refresh']").attribute('content').value.starts_with? '0;' rescue false
24
+ @html.xpath("//meta[@http-equiv='refresh']").attribute('content').value.start_with? '0;' rescue false
25
25
  end
26
26
 
27
27
  end
@@ -46,7 +46,7 @@ class LinkCheck < ::HTMLProofer::Check
46
46
  check_sri(line, content) if @link.check_sri? && node.name == 'link'
47
47
  # we need to skip these for now; although the domain main be valid,
48
48
  # curl/Typheous inaccurately return 404s for some links. cc https://git.io/vyCFx
49
- next if @link.try(:rel) == 'dns-prefetch'
49
+ next if @link.respond_to?(:rel) && @link.rel == 'dns-prefetch'
50
50
  add_to_external_urls(@link.href)
51
51
  next
52
52
  elsif !@link.internal? && !@link.exists?
@@ -30,7 +30,7 @@ module HTMLProofer
30
30
 
31
31
  @html = check.html
32
32
 
33
- parent_attributes = obj.ancestors.map { |a| a.try(:attributes) }
33
+ parent_attributes = obj.ancestors.map { |a| a.respond_to?(:attributes) && a.attributes }
34
34
  parent_attributes.pop # remove document at the end
35
35
  @parent_ignorable = parent_attributes.any? { |a| !a['data-proofer-ignore'].nil? }
36
36
 
@@ -62,7 +62,7 @@ module HTMLProofer
62
62
  rescue
63
63
  return result # Invalid encoding; it's not gonna be html.
64
64
  end
65
- if HTML_SIGNATURE.any? { |sig| html.upcase.starts_with? sig }
65
+ if HTML_SIGNATURE.any? { |sig| html.upcase.start_with? sig }
66
66
  parsed = HTMLProofer::Runner.new(
67
67
  'response',
68
68
  Middleware.options
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTMLProofer
4
- VERSION = '3.11.1'.freeze
4
+ VERSION = '3.12.0'.freeze
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.11.1
4
+ version: 3.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-17 00:00:00.000000000 Z
11
+ date: 2019-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.2
19
+ version: '0.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.2
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.9'
33
+ version: '1.10'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.9'
40
+ version: '1.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rainbow
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -109,25 +109,19 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '2.3'
111
111
  - !ruby/object:Gem::Dependency
112
- name: activesupport
112
+ name: timerizer
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '4.2'
118
- - - "<"
115
+ - - "~>"
119
116
  - !ruby/object:Gem::Version
120
- version: '6.0'
117
+ version: '0.3'
121
118
  type: :runtime
122
119
  prerelease: false
123
120
  version_requirements: !ruby/object:Gem::Requirement
124
121
  requirements:
125
- - - ">="
126
- - !ruby/object:Gem::Version
127
- version: '4.2'
128
- - - "<"
122
+ - - "~>"
129
123
  - !ruby/object:Gem::Version
130
- version: '6.0'
124
+ version: '0.3'
131
125
  - !ruby/object:Gem::Dependency
132
126
  name: redcarpet
133
127
  requirement: !ruby/object:Gem::Requirement
@@ -328,8 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
328
322
  - !ruby/object:Gem::Version
329
323
  version: '0'
330
324
  requirements: []
331
- rubyforge_project:
332
- rubygems_version: 2.7.6
325
+ rubygems_version: 3.0.6
333
326
  signing_key:
334
327
  specification_version: 4
335
328
  summary: A set of tests to validate your HTML output. These tests check if your image