site_validator 1.7.4 → 2.0.0
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/README.md +2 -2
- data/lib/site_validator/page.rb +18 -6
- data/lib/site_validator/templates/site_validator.html.erb +4 -4
- data/lib/site_validator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1dc1d6da4eb894c3a55258350c093bb8be428a1f
|
|
4
|
+
data.tar.gz: 9c57a23df123347097e9c75917476bd358f85340
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 827963110bd64b96c868fac383c8958504e233dd23b3613fd8739956d22575ad7815893cb79e0928c8d41df8eb302a5ec35e9759746036d4fcb6d432cb897cff
|
|
7
|
+
data.tar.gz: bbae855eeb30bebea3e8bb0604c521295fc0e82630257b0a8e4f498cce31506b35c5c2d468e7a69e312f039f64e90177a6f68bef054b9810d8d5c53f206f5bd5
|
data/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
site_validator is the free, open source version of the [Site Validator app](https://sitevalidator.com).
|
|
4
4
|
|
|
5
|
-
Just pass it your site's URL and it will crawl its internal links and validate their HTML for you, generating a comprehensive validation report
|
|
5
|
+
Just pass it your site's URL and it will crawl its internal links and validate their HTML for you, generating a comprehensive validation report.
|
|
6
6
|
|
|
7
|
-
[](https://sitevalidator.com/
|
|
7
|
+
[](https://sitevalidator.wistia.com/medias/tk2nit1zdd)
|
|
8
8
|
|
|
9
9
|
For advanced features like CSS validation, deep-link crawling, results storing and team collaborations, check the awesome [Site Validator](https://sitevalidator.com/).
|
|
10
10
|
|
data/lib/site_validator/page.rb
CHANGED
|
@@ -10,11 +10,15 @@ module SiteValidator
|
|
|
10
10
|
# In case of an exception happens when validating, it is tracked
|
|
11
11
|
#
|
|
12
12
|
class Page
|
|
13
|
-
attr_accessor :url, :timeout, :exception
|
|
13
|
+
attr_accessor :url, :timeout, :validator_uri, :user_agent, :exception
|
|
14
14
|
|
|
15
|
-
def initialize(url,
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
def initialize(url, options = {})
|
|
16
|
+
options = defaults.merge(options)
|
|
17
|
+
|
|
18
|
+
@url = url
|
|
19
|
+
@timeout = options[:timeout]
|
|
20
|
+
@validator_uri = options[:validator_uri]
|
|
21
|
+
@user_agent = options[:user_agent]
|
|
18
22
|
end
|
|
19
23
|
|
|
20
24
|
##
|
|
@@ -59,6 +63,14 @@ module SiteValidator
|
|
|
59
63
|
|
|
60
64
|
private
|
|
61
65
|
|
|
66
|
+
def defaults
|
|
67
|
+
{
|
|
68
|
+
timeout: 20,
|
|
69
|
+
validator_uri: 'http://validator.w3.org/check',
|
|
70
|
+
user_agent: SiteValidator::USER_AGENT
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
62
74
|
##
|
|
63
75
|
# Gets the validations for this page, ensuring it times out soon
|
|
64
76
|
def validations
|
|
@@ -74,8 +86,8 @@ module SiteValidator
|
|
|
74
86
|
##
|
|
75
87
|
# Returns an instance of MarkupValidator, with the URL set to the one in ENV or its default
|
|
76
88
|
def markup_validator
|
|
77
|
-
@markup_validator ||= MarkupValidator.new(:validator_uri =>
|
|
78
|
-
'user-agent' =>
|
|
89
|
+
@markup_validator ||= MarkupValidator.new(:validator_uri => validator_uri,
|
|
90
|
+
'user-agent' => user_agent)
|
|
79
91
|
end
|
|
80
92
|
|
|
81
93
|
##
|
|
@@ -104,12 +104,12 @@
|
|
|
104
104
|
<span class="icon-bar"></span>
|
|
105
105
|
<span class="icon-bar"></span>
|
|
106
106
|
</button>
|
|
107
|
-
<a class="navbar-brand" href="
|
|
107
|
+
<a class="navbar-brand" href="http://sitevalidator.com">Site Validator</a>
|
|
108
108
|
</div>
|
|
109
109
|
<div class="collapse navbar-collapse">
|
|
110
110
|
<ul class="nav navbar-nav">
|
|
111
|
-
<li><a href="
|
|
112
|
-
<li><a href="
|
|
111
|
+
<li><a href="https://app.sitevalidator.com/pricing">Plans and pricing</a></li>
|
|
112
|
+
<li><a href="http://docs.sitevalidator.com/">Documentation</a></li>
|
|
113
113
|
<li><a href="mailto:support@sitevalidator.com">Contact</a></li>
|
|
114
114
|
</ul>
|
|
115
115
|
</div><!-- /.nav-collapse -->
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
|
|
228
228
|
<footer class="well well-lg">
|
|
229
229
|
<p>This site validation report has been generated using the free, open source <a href="http://gem.sitevalidator.com">Site Validator ruby gem</a>.</p>
|
|
230
|
-
<p>For deep link crawling, HTML+CSS validation, and storage of results, you can use the <a href="
|
|
230
|
+
<p>For deep link crawling, HTML+CSS validation, and storage of results, you can use the <a href="http://sitevalidator.com">Site Validator app</a>.</p>
|
|
231
231
|
<p class="small">We're independent, not associated with the W3C.</p>
|
|
232
232
|
</footer>
|
|
233
233
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: site_validator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jaime Iniesta
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: w3c_validators
|