validate-website 1.11.1 → 1.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: 7208a9c728f7798aecc7a10bec8a3537940a6857e3eb4f6612efa551f2871a94
4
- data.tar.gz: 25e5112b42c14a6ed86f0271fba1bb9ada63c1d92cc75414a227716289e241f8
3
+ metadata.gz: e75c6ffc6e4b8087ecdeff96f028c95aec4d7a145f36e8b7f1290aac2958a711
4
+ data.tar.gz: 8e57b037034aa7e20cbba2f420f478dd66bb362b40a592a6d8c375994144fd64
5
5
  SHA512:
6
- metadata.gz: 95962fe71e144cc5c8f244e1960556e56c9956bdcd5852e194532ee16b40dfbda5ba39db75169651ddd4048afc79311fdee2aa1087dddc3388aaa894c4dc27fe
7
- data.tar.gz: 6a6e8185f8a359e0482c0ef5893b28d307a31be560a2e83bfd19f88f042cfbd3ec37e244f602e5ea4a6876afce9b8d2a38f98f645452168b752c03ee62fdc70d
6
+ metadata.gz: 846ee7365d54a843644857244af7a6c9a1616f080a667b0dbcf5aa6fc17047d4c6902b15eacf6f88ee514466963f0899d31b60d5038c0c9a2147db1083de6186
7
+ data.tar.gz: fcc0f3f832bf725e6b2b464d500ee19663c928999a60f038298c72fe96cc0d32c06d0c58a6e8d8f2b10e6f4cc652e1cd9c0e5ac42ad6ac596c27a822edf69649
data/History.md CHANGED
@@ -1,4 +1,15 @@
1
1
 
2
+ 1.12.0 / 2022-11-15
3
+ ===================
4
+
5
+ * Regen manpages
6
+ * Bump year
7
+ * Fix lint Metrics/AbcSize on check_page
8
+ * Fix test/static_test.rb with relative path
9
+ * Add relative link test fail
10
+ * Fix test/static_test.rb with relative path
11
+ * Nokigumbo is merged into nokogiri 1.12~
12
+
2
13
  1.11.1 / 2021-01-10
3
14
  ===================
4
15
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2009-2021 Laurent Arnoud <laurent@spkdev.net>
3
+ Copyright (c) 2009-2022 Laurent Arnoud <laurent@spkdev.net>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -95,9 +95,9 @@ If the libtidy5 is found on your system this will be the default to validate
95
95
  your html5 document. This does not depend on a tier service everything is done
96
96
  locally.
97
97
 
98
- #### Nokogumbo
98
+ #### nokogiri
99
99
 
100
- Nokogumbo can validate html5 document without tier service but reports less
100
+ nokogiri can validate html5 document without tier service but reports less
101
101
  errors than tidy.
102
102
 
103
103
  #### Validator.nu web service
@@ -150,7 +150,7 @@ See [GitHub](https://github.com/spk/validate-website/graphs/contributors).
150
150
 
151
151
  The MIT License
152
152
 
153
- Copyright (c) 2009-2021 Laurent Arnoud <laurent@spkdev.net>
153
+ Copyright (c) 2009-2022 Laurent Arnoud <laurent@spkdev.net>
154
154
 
155
155
  ---
156
156
  [![Build](https://img.shields.io/gitlab/pipeline/spkdev/validate-website/master)](https://gitlab.com/spkdev/validate-website/-/commits/master)
@@ -56,7 +56,7 @@ module ValidateWebsite
56
56
  opt.regexp('-i', '--ignore',
57
57
  'Validation errors to ignore (ex: "valign|autocorrect")')
58
58
  opt.string('-x', '--html5-validator',
59
- 'Change default html5 validator engine (tidy/nu/nokogumbo)',
59
+ 'Change default html5 validator engine (tidy/nu/nokogiri)',
60
60
  default: DEFAULT_OPTIONS[:html5_validator])
61
61
  opt.string('-5', '--html5-validator-service-url',
62
62
  'Change default html5 validator service URL for "nu" engine')
@@ -61,17 +61,16 @@ module ValidateWebsite
61
61
  def check_page(file, page)
62
62
  if page.html? && options[:markup]
63
63
  keys = %i[ignore html5_validator]
64
- # slice does not exists on Ruby <= 2.4
65
- slice = Hash[[keys, options.values_at(*keys)].transpose]
64
+ slice = options.slice(*keys)
66
65
  validate(page.doc, page.body, file, slice)
67
66
  end
68
- check_static_not_found(page.links) if options[:not_found]
67
+ check_static_not_found(page.links, page.url.to_s) if options[:not_found]
69
68
  end
70
69
 
71
70
  # check files linked on static document
72
71
  # see lib/validate_website/runner.rb
73
- def check_static_not_found(links)
74
- static_links = links.map { |l| StaticLink.new(l, @site) }
72
+ def check_static_not_found(links, site = @site)
73
+ static_links = links.map { |l| StaticLink.new(l, site) }
75
74
  static_links.each do |static_link|
76
75
  next unless static_link.check?
77
76
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'uri'
4
4
 
5
- require 'nokogumbo' unless ValidateWebsite.jruby?
5
+ require 'nokogiri' unless ValidateWebsite.jruby?
6
6
  require 'w3c_validators'
7
7
 
8
8
  require 'validate_website/validator_class_methods'
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Version file for ValidateWebsite
4
4
  module ValidateWebsite
5
- VERSION = '1.11.1'
5
+ VERSION = '1.12.0'
6
6
 
7
7
  def self.jruby? # :nodoc:
8
8
  defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
@@ -1,13 +1,13 @@
1
1
  '\" t
2
2
  .\" Title: validate-website-static
3
3
  .\" Author: [see the "AUTHOR(S)" section]
4
- .\" Generator: Asciidoctor 1.5.8
5
- .\" Date: 2021-01-10
4
+ .\" Generator: Asciidoctor 2.0.18
5
+ .\" Date: 2022-05-02
6
6
  .\" Manual: \ \&
7
7
  .\" Source: \ \&
8
8
  .\" Language: English
9
9
  .\"
10
- .TH "VALIDATE\-WEBSITE\-STATIC" "1" "2021-01-10" "\ \&" "\ \&"
10
+ .TH "VALIDATE\-WEBSITE\-STATIC" "1" "2022-05-02" "\ \&" "\ \&"
11
11
  .ie \n(.g .ds Aq \(aq
12
12
  .el .ds Aq '
13
13
  .ss \n[.ss] 0
@@ -28,7 +28,7 @@
28
28
  . LINKSTYLE blue R < >
29
29
  .\}
30
30
  .SH "NAME"
31
- validate\-website\-static \- check the validity of your documents
31
+ validate-website-static \- check the validity of your documents
32
32
  .SH "SYNOPSIS"
33
33
  .sp
34
34
  \fBvalidate\-website\-static\fP [\fIOPTIONS\fP]
@@ -82,7 +82,7 @@ Show colored output (Default: true)
82
82
  .sp
83
83
  \fB\-x\fP, \fB\-\-html5\-validator\fP \fIVALIDATOR\fP
84
84
  .RS 4
85
- Change default html5 validator engine (tidy/nu/nokogumbo)
85
+ Change default html5 validator engine (tidy/nu/nokogiri)
86
86
  .RE
87
87
  .sp
88
88
  \fB\-5\fP, \fB\-\-html5\-validator\-service\-url\fP \fIURL\fP
@@ -1,13 +1,13 @@
1
1
  '\" t
2
2
  .\" Title: validate-website
3
3
  .\" Author: [see the "AUTHOR(S)" section]
4
- .\" Generator: Asciidoctor 1.5.8
5
- .\" Date: 2021-01-10
4
+ .\" Generator: Asciidoctor 2.0.18
5
+ .\" Date: 2022-05-02
6
6
  .\" Manual: \ \&
7
7
  .\" Source: \ \&
8
8
  .\" Language: English
9
9
  .\"
10
- .TH "VALIDATE\-WEBSITE" "1" "2021-01-10" "\ \&" "\ \&"
10
+ .TH "VALIDATE\-WEBSITE" "1" "2022-05-02" "\ \&" "\ \&"
11
11
  .ie \n(.g .ds Aq \(aq
12
12
  .el .ds Aq '
13
13
  .ss \n[.ss] 0
@@ -28,7 +28,7 @@
28
28
  . LINKSTYLE blue R < >
29
29
  .\}
30
30
  .SH "NAME"
31
- validate\-website \- Web crawler for checking the validity of your documents
31
+ validate-website \- Web crawler for checking the validity of your documents
32
32
  .SH "SYNOPSIS"
33
33
  .sp
34
34
  \fBvalidate\-website\fP [\fIOPTIONS\fP]
@@ -87,7 +87,7 @@ Show colored output (Default: true)
87
87
  .sp
88
88
  \fB\-x\fP, \fB\-\-html5\-validator\fP \fIVALIDATOR\fP
89
89
  .RS 4
90
- Change default html5 validator engine (tidy/nu/nokogumbo)
90
+ Change default html5 validator engine (tidy/nu/nokogiri)
91
91
  .RE
92
92
  .sp
93
93
  \fB\-5\fP, \fB\-\-html5\-validator\-service\-url\fP \fIURL\fP
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>title</title>
6
+ <meta name="description" content="" />
7
+ <meta name="keywords" content="" />
8
+ <meta name="author" content="" />
9
+ </head>
10
+ <body>
11
+ <header>
12
+ <nav>
13
+ <ul>
14
+ <li><a href="ryzom-naissance-du-projet-libre-ryzom-forge.md" title="title">my url</a></li>
15
+ </ul>
16
+ </nav>
17
+ </header>
18
+ </body>
19
+ </html>
data/test/static_test.rb CHANGED
@@ -34,15 +34,14 @@ describe ValidateWebsite::Static do
34
34
  end
35
35
 
36
36
  it 'not found' do
37
- pattern = File.join(File.dirname(__FILE__), '**/*.html')
38
37
  Dir.chdir('test/data') do
39
38
  _out, _err = capture_io do
40
- @validate_website.crawl(pattern: pattern,
39
+ @validate_website.crawl(pattern: '**/*.html',
41
40
  site: 'https://linuxfr.org/',
42
41
  markup: false,
43
42
  not_found: true)
44
43
  end
45
- _(@validate_website.not_founds_count).must_equal 213
44
+ _(@validate_website.not_founds_count).must_equal 210
46
45
  end
47
46
  end
48
47
 
@@ -99,23 +99,23 @@ describe ValidateWebsite::Validator do
99
99
  end
100
100
  end
101
101
 
102
- describe('with nokogumbo') do
102
+ describe('with nokogiri') do
103
103
  it 'have an array of errors' do
104
- skip('nokogumbo dont support jruby') if ValidateWebsite.jruby?
104
+ skip('nokogiri dont support jruby') if ValidateWebsite.jruby?
105
105
  validator = subject.new(@html5_page.doc,
106
106
  @html5_page.body,
107
- html5_validator: :nokogumbo)
107
+ html5_validator: :nokogiri)
108
108
  _(validator.valid?).must_equal false
109
109
  _(validator.errors.size).must_equal 1
110
110
  end
111
111
 
112
112
  it 'exclude errors ignored by :ignore option' do
113
- skip('nokogumbo dont support jruby') if ValidateWebsite.jruby?
113
+ skip('nokogiri dont support jruby') if ValidateWebsite.jruby?
114
114
  ignore = /That tag isn't allowed here/
115
115
  validator = subject.new(@html5_page.doc,
116
116
  @html5_page.body,
117
117
  ignore: ignore,
118
- html5_validator: :nokogumbo)
118
+ html5_validator: :nokogiri)
119
119
  _(validator.valid?).must_equal true
120
120
  _(validator.errors.size).must_equal 0
121
121
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validate-website
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Arnoud
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-10 00:00:00.000000000 Z
11
+ date: 2022-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crass
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: nokogumbo
28
+ name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.0'
33
+ version: '1.12'
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: '2.0'
40
+ version: '1.12'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: paint
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -265,6 +265,7 @@ files:
265
265
  - test/data/html4-strict.html
266
266
  - test/data/html5-fail.html
267
267
  - test/data/html5.html
268
+ - test/data/news/index.html
268
269
  - test/data/news/ryzom-naissance-du-projet-libre-ryzom-forge.md
269
270
  - test/data/validator.nu-failure.json
270
271
  - test/data/validator.nu-success.json
@@ -279,7 +280,7 @@ homepage: http://github.com/spk/validate-website
279
280
  licenses:
280
281
  - MIT
281
282
  metadata: {}
282
- post_install_message:
283
+ post_install_message:
283
284
  rdoc_options: []
284
285
  require_paths:
285
286
  - lib
@@ -294,12 +295,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
294
295
  - !ruby/object:Gem::Version
295
296
  version: '0'
296
297
  requirements: []
297
- rubygems_version: 3.2.0.rc.2
298
- signing_key:
298
+ rubygems_version: 3.3.15
299
+ signing_key:
299
300
  specification_version: 4
300
301
  summary: Web crawler for checking the validity of your documents
301
302
  test_files:
302
- - test/static_test.rb
303
303
  - test/core_test.rb
304
- - test/validator_test.rb
305
304
  - test/crawler_test.rb
305
+ - test/static_test.rb
306
+ - test/validator_test.rb