site_validator 1.2.5 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -1
- data/README.md +13 -1
- data/lib/site_validator/page.rb +2 -1
- 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: 95d0ce1bb52f35a2d3e6e2d5801fa0ac29063877
|
4
|
+
data.tar.gz: a02e1698c7fb26338675ec32aaf9fa634b69c465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5db4ab10ee45ecddd09e4c3bdb83ecdb0205a8769c09eab0ede216309c2733356c7fa7424aecd78cbf2fd074467aa30040e8cf0645d317f407e1301ef24ac50
|
7
|
+
data.tar.gz: f8cef281d418281a70ec42cc629df8b678b26ab3e6b89b15df637ebc437505af41e764cdc01c9c39065603ccf7ce453785bc6b6afcac3541e83c9ae2c8df2553
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -38,9 +38,21 @@ By default, site_validator will use the official W3C Validator server at http://
|
|
38
38
|
|
39
39
|
Follow this guide to know how to setup your own validation server: https://github.com/tlvince/w3c-validator-guide
|
40
40
|
|
41
|
+
##User Agent
|
42
|
+
|
43
|
+
By default, site_validator will tell the W3C validator software to use the User Agent string `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36` instead of the default `W3C_Validator/XX.xxxx`.
|
44
|
+
|
45
|
+
I've found that some servers will produce different HTML depending on the User Agent string, and this can lead to unexpected results for the web developer that is seeing this site with a browser, but getting weird validation errors from the W3C validator, as it's seeing different HTML.
|
46
|
+
|
47
|
+
If you want to override this, you can set up you own User Agent string with an environment variable, like:
|
48
|
+
|
49
|
+
ENV['W3C_MARKUP_VALIDATOR_USER_AGENT'] = 'W3C_Validator/1.6.5.4'
|
50
|
+
|
51
|
+
More info about the `user-agent` option on the W3C Validator can be found [here](http://validator.w3.org/docs/users.html#option-user-agent).
|
52
|
+
|
41
53
|
##Notes:
|
42
54
|
|
43
|
-
This gem requires Ruby 1.9, and has been tested on Ruby 1.9.2
|
55
|
+
This gem requires Ruby 1.9, and has been tested on Ruby 1.9.2, 1.9.3 and 2.0.
|
44
56
|
|
45
57
|
##License:
|
46
58
|
|
data/lib/site_validator/page.rb
CHANGED
@@ -68,7 +68,8 @@ module SiteValidator
|
|
68
68
|
##
|
69
69
|
# Returns an instance of MarkupValidator, with the URL set to the one in ENV or its default
|
70
70
|
def markup_validator
|
71
|
-
@markup_validator ||= MarkupValidator.new(:validator_uri => ENV['W3C_MARKUP_VALIDATOR_URI'] || 'http://validator.w3.org/check'
|
71
|
+
@markup_validator ||= MarkupValidator.new(:validator_uri => ENV['W3C_MARKUP_VALIDATOR_URI'] || 'http://validator.w3.org/check',
|
72
|
+
'user-agent' => ENV['W3C_MARKUP_VALIDATOR_USER_AGENT'] || 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36')
|
72
73
|
end
|
73
74
|
|
74
75
|
##
|
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: 1.
|
4
|
+
version: 1.3.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: 2013-09-
|
11
|
+
date: 2013-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: w3c_validators
|