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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f105d17ef7988b25bce51050e6a105274aa6d932
4
- data.tar.gz: a3dbd8a3c79709d8a361efb93f4c7e5cd3061378
3
+ metadata.gz: 95d0ce1bb52f35a2d3e6e2d5801fa0ac29063877
4
+ data.tar.gz: a02e1698c7fb26338675ec32aaf9fa634b69c465
5
5
  SHA512:
6
- metadata.gz: 493c0530a53153b7c390ad05c0407d9c1f114f0afacddce3dac27fedfbc3c57c2f544dbd2980d6582830d33062ed9e95bcdd5390657b461769cf52b142ff349a
7
- data.tar.gz: 7b19c35d266d833da7787dd0ece2eba65074ea1b8c86e1836f70616cccf215e626a9fd09fbb39864abfc56883e2c033094a458e6b572b2343d157fa5dbadc2c8
6
+ metadata.gz: b5db4ab10ee45ecddd09e4c3bdb83ecdb0205a8769c09eab0ede216309c2733356c7fa7424aecd78cbf2fd074467aa30040e8cf0645d317f407e1301ef24ac50
7
+ data.tar.gz: f8cef281d418281a70ec42cc629df8b678b26ab3e6b89b15df637ebc437505af41e764cdc01c9c39065603ccf7ce453785bc6b6afcac3541e83c9ae2c8df2553
@@ -1 +1,4 @@
1
- rvm: 1.9.2
1
+ rvm:
2
+ - 2.0.0
3
+ - 1.9.3
4
+ - 1.9.2
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-p0
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
 
@@ -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
  ##
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module SiteValidator
4
- VERSION = "1.2.5"
4
+ VERSION = "1.3.0"
5
5
  end
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.2.5
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-25 00:00:00.000000000 Z
11
+ date: 2013-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: w3c_validators