validate-website 1.9.0 → 1.9.1
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 +4 -4
- data/History.md +7 -0
- data/LICENSE +1 -1
- data/README.md +26 -25
- data/lib/validate_website/core.rb +5 -1
- data/lib/validate_website/crawl.rb +1 -0
- data/lib/validate_website/static.rb +2 -0
- data/lib/validate_website/version.rb +1 -1
- data/man/man1/validate-website-static.1 +17 -8
- data/man/man1/validate-website.1 +17 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60082f1dc222de92a3465b0487e6047597d7605fd2199e15f246a5930ddd5ea3
|
4
|
+
data.tar.gz: 1fd7bd74bc0b58bbb16e82ae396309db5638362f6f9853d80161849299ff28d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ab5fa6da0d050fc39acabdd4cb26a764acfdb609df4786cb22f55af5d2f500e0638a55e67505cb1d6e1595e0c04ede5ad4ed88b46bf078bc09f58585b7f481c
|
7
|
+
data.tar.gz: '0199501f535de09d55bc9a8f28549f4c01a94d9444f12732ad02fc503e36158daa1535a61e9b349ea462eb4799bebb5a599417e93dbe2b0abd92b0e0319abb28'
|
data/History.md
CHANGED
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2009-
|
3
|
+
Copyright (c) 2009-2019 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
@@ -10,34 +10,34 @@ Web crawler for checking the validity of your documents
|
|
10
10
|
|
11
11
|
### Debian
|
12
12
|
|
13
|
-
|
13
|
+
```
|
14
14
|
apt install ruby-dev libxslt1-dev libxml2-dev
|
15
|
-
|
15
|
+
```
|
16
16
|
|
17
17
|
If you want complete local validation look [tidy
|
18
18
|
packages](https://binaries.html-tidy.org/)
|
19
19
|
|
20
20
|
### RubyGems
|
21
21
|
|
22
|
-
|
22
|
+
```
|
23
23
|
gem install validate-website
|
24
|
-
|
24
|
+
```
|
25
25
|
|
26
26
|
## Synopsis
|
27
27
|
|
28
|
-
|
28
|
+
```
|
29
29
|
validate-website [OPTIONS]
|
30
30
|
validate-website-static [OPTIONS]
|
31
|
-
|
31
|
+
```
|
32
32
|
|
33
33
|
## Examples
|
34
34
|
|
35
|
-
|
35
|
+
```
|
36
36
|
validate-website -v -s https://www.ruby-lang.org/
|
37
37
|
validate-website -v -x tidy -s https://www.ruby-lang.org/
|
38
38
|
validate-website -v -x nu -s https://www.ruby-lang.org/
|
39
39
|
validate-website -h
|
40
|
-
|
40
|
+
```
|
41
41
|
|
42
42
|
## Description
|
43
43
|
|
@@ -59,30 +59,31 @@ Service](https://checker.html5.org/).
|
|
59
59
|
|
60
60
|
## On your application
|
61
61
|
|
62
|
-
|
62
|
+
``` ruby
|
63
63
|
require 'validate_website/validator'
|
64
64
|
body = '<!DOCTYPE html><html></html>'
|
65
65
|
v = ValidateWebsite::Validator.new(Nokogiri::HTML(body), body)
|
66
66
|
v.valid? # => false
|
67
|
-
|
67
|
+
```
|
68
68
|
|
69
69
|
## Jekyll static site validation
|
70
70
|
|
71
71
|
You can add this Rake task to validate a
|
72
72
|
[jekyll](https://github.com/jekyll/jekyll) site:
|
73
73
|
|
74
|
-
|
74
|
+
``` ruby
|
75
75
|
desc 'validate _site with validate website'
|
76
76
|
task validate: :build do
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
Dir.chdir("_site") do
|
78
|
+
system("validate-website-static",
|
79
|
+
"--verbose",
|
80
|
+
"--exclude", "examples",
|
81
|
+
"--site", HTTP_URL)
|
82
|
+
exit($?.exitstatus)
|
82
83
|
end
|
83
84
|
end
|
84
85
|
end
|
85
|
-
|
86
|
+
```
|
86
87
|
|
87
88
|
## More info
|
88
89
|
|
@@ -109,17 +110,17 @@ validation service.
|
|
109
110
|
You can download [validator](https://github.com/validator/validator) jar and
|
110
111
|
start it with:
|
111
112
|
|
112
|
-
|
113
|
+
```
|
113
114
|
java -cp PATH_TO/vnu.jar nu.validator.servlet.Main 8888
|
114
|
-
|
115
|
+
```
|
115
116
|
|
116
117
|
Then you can use validate-website option:
|
117
118
|
|
118
|
-
|
119
|
+
```
|
119
120
|
--html5-validator-service-url http://localhost:8888/
|
120
121
|
# or
|
121
122
|
export VALIDATOR_NU_URL="http://localhost:8888/"
|
122
|
-
|
123
|
+
```
|
123
124
|
|
124
125
|
This will prevent you to be blacklisted from validator webservice.
|
125
126
|
|
@@ -127,9 +128,9 @@ This will prevent you to be blacklisted from validator webservice.
|
|
127
128
|
|
128
129
|
With standard environment:
|
129
130
|
|
130
|
-
|
131
|
+
```
|
131
132
|
bundle exec rake
|
132
|
-
|
133
|
+
```
|
133
134
|
|
134
135
|
## Credits
|
135
136
|
|
@@ -144,10 +145,10 @@ See [GitHub](https://github.com/spk/validate-website/graphs/contributors).
|
|
144
145
|
|
145
146
|
The MIT License
|
146
147
|
|
147
|
-
Copyright (c) 2009-
|
148
|
+
Copyright (c) 2009-2019 Laurent Arnoud <laurent@spkdev.net>
|
148
149
|
|
149
150
|
---
|
150
|
-
[](https://travis-ci.org/spk/validate-website)
|
151
152
|
[](https://rubygems.org/gems/validate-website)
|
152
153
|
[](http://www.rubydoc.info/gems/validate-website)
|
153
154
|
[](http://opensource.org/licenses/MIT "MIT")
|
@@ -26,6 +26,7 @@ module ValidateWebsite
|
|
26
26
|
EXIT_FAILURE_MARKUP = 64
|
27
27
|
EXIT_FAILURE_NOT_FOUND = 65
|
28
28
|
EXIT_FAILURE_MARKUP_NOT_FOUND = 66
|
29
|
+
START_MESSAGE = 'Validating'.freeze
|
29
30
|
|
30
31
|
# Initialize core ValidateWebsite class
|
31
32
|
# @example
|
@@ -39,7 +40,6 @@ module ValidateWebsite
|
|
39
40
|
@site = @options[:site]
|
40
41
|
@service_url = @options[:html5_validator_service_url]
|
41
42
|
Validator.html5_validator_service_url = @service_url if @service_url
|
42
|
-
puts color(:note, "validating #{@site}\n", @options[:color])
|
43
43
|
end
|
44
44
|
|
45
45
|
def errors?
|
@@ -71,6 +71,10 @@ module ValidateWebsite
|
|
71
71
|
|
72
72
|
private
|
73
73
|
|
74
|
+
def start_message(type)
|
75
|
+
puts color(:note, "#{START_MESSAGE} #{type}\n", @options[:color])
|
76
|
+
end
|
77
|
+
|
74
78
|
def check_css_syntax(page)
|
75
79
|
nodes = Crass::Parser.parse_stylesheet(page.body)
|
76
80
|
return unless any_css_errors?(nodes)
|
@@ -5,12 +5,14 @@ module ValidateWebsite
|
|
5
5
|
# Class for validation Static website
|
6
6
|
class Static < Core
|
7
7
|
CONTENT_TYPES = ['text/html', 'text/xhtml+xml'].freeze
|
8
|
+
START_MESSAGE_TYPE = 'files'.freeze
|
8
9
|
|
9
10
|
attr_reader :history_count
|
10
11
|
|
11
12
|
def initialize(options = {}, validation_type = :static)
|
12
13
|
@history_count = 0
|
13
14
|
super
|
15
|
+
start_message("#{START_MESSAGE_TYPE} in #{Dir.pwd} (#{@site} as site)")
|
14
16
|
end
|
15
17
|
|
16
18
|
# @param [Hash] options
|
@@ -1,23 +1,32 @@
|
|
1
1
|
'\" t
|
2
2
|
.\" Title: validate-website-static
|
3
|
-
.\" Author: [see the "
|
4
|
-
.\" Generator: Asciidoctor 1.5.
|
5
|
-
.\" Date:
|
3
|
+
.\" Author: [see the "AUTHOR(S)" section]
|
4
|
+
.\" Generator: Asciidoctor 1.5.8
|
5
|
+
.\" Date: 2019-01-09
|
6
6
|
.\" Manual: \ \&
|
7
7
|
.\" Source: \ \&
|
8
8
|
.\" Language: English
|
9
9
|
.\"
|
10
|
-
.TH "VALIDATE\-WEBSITE\-STATIC" "1" "
|
10
|
+
.TH "VALIDATE\-WEBSITE\-STATIC" "1" "2019-01-09" "\ \&" "\ \&"
|
11
11
|
.ie \n(.g .ds Aq \(aq
|
12
12
|
.el .ds Aq '
|
13
13
|
.ss \n[.ss] 0
|
14
14
|
.nh
|
15
15
|
.ad l
|
16
16
|
.de URL
|
17
|
-
\\$2
|
17
|
+
\fI\\$2\fP <\\$1>\\$3
|
18
18
|
..
|
19
|
-
.
|
20
|
-
.
|
19
|
+
.als MTO URL
|
20
|
+
.if \n[.g] \{\
|
21
|
+
. mso www.tmac
|
22
|
+
. am URL
|
23
|
+
. ad l
|
24
|
+
. .
|
25
|
+
. am MTO
|
26
|
+
. ad l
|
27
|
+
. .
|
28
|
+
. LINKSTYLE blue R < >
|
29
|
+
.\}
|
21
30
|
.SH "NAME"
|
22
31
|
validate\-website\-static \- check the validity of your documents
|
23
32
|
.SH "SYNOPSIS"
|
@@ -119,5 +128,5 @@ Laurent Arnoud \c
|
|
119
128
|
.sp
|
120
129
|
The MIT License
|
121
130
|
.sp
|
122
|
-
Copyright (c) 2009\-
|
131
|
+
Copyright (c) 2009\-2019 \c
|
123
132
|
.MTO "laurent\(atspkdev.net" "Laurent Arnoud" ""
|
data/man/man1/validate-website.1
CHANGED
@@ -1,23 +1,32 @@
|
|
1
1
|
'\" t
|
2
2
|
.\" Title: validate-website
|
3
|
-
.\" Author: [see the "
|
4
|
-
.\" Generator: Asciidoctor 1.5.
|
5
|
-
.\" Date:
|
3
|
+
.\" Author: [see the "AUTHOR(S)" section]
|
4
|
+
.\" Generator: Asciidoctor 1.5.8
|
5
|
+
.\" Date: 2019-01-09
|
6
6
|
.\" Manual: \ \&
|
7
7
|
.\" Source: \ \&
|
8
8
|
.\" Language: English
|
9
9
|
.\"
|
10
|
-
.TH "VALIDATE\-WEBSITE" "1" "
|
10
|
+
.TH "VALIDATE\-WEBSITE" "1" "2019-01-09" "\ \&" "\ \&"
|
11
11
|
.ie \n(.g .ds Aq \(aq
|
12
12
|
.el .ds Aq '
|
13
13
|
.ss \n[.ss] 0
|
14
14
|
.nh
|
15
15
|
.ad l
|
16
16
|
.de URL
|
17
|
-
\\$2
|
17
|
+
\fI\\$2\fP <\\$1>\\$3
|
18
18
|
..
|
19
|
-
.
|
20
|
-
.
|
19
|
+
.als MTO URL
|
20
|
+
.if \n[.g] \{\
|
21
|
+
. mso www.tmac
|
22
|
+
. am URL
|
23
|
+
. ad l
|
24
|
+
. .
|
25
|
+
. am MTO
|
26
|
+
. ad l
|
27
|
+
. .
|
28
|
+
. LINKSTYLE blue R < >
|
29
|
+
.\}
|
21
30
|
.SH "NAME"
|
22
31
|
validate\-website \- Web crawler for checking the validity of your documents
|
23
32
|
.SH "SYNOPSIS"
|
@@ -124,5 +133,5 @@ Laurent Arnoud \c
|
|
124
133
|
.sp
|
125
134
|
The MIT License
|
126
135
|
.sp
|
127
|
-
Copyright (c) 2009\-
|
136
|
+
Copyright (c) 2009\-2019 \c
|
128
137
|
.MTO "laurent\(atspkdev.net" "Laurent Arnoud" ""
|
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.9.
|
4
|
+
version: 1.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurent Arnoud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: crass
|