site_validator 1.7.4 → 2.0.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: 5fd528589344f94d2f1d45e8d9c5b461e9b2c26e
4
- data.tar.gz: 4b6730a6f9a58187b1130e8b95b2ec223a0750fc
3
+ metadata.gz: 1dc1d6da4eb894c3a55258350c093bb8be428a1f
4
+ data.tar.gz: 9c57a23df123347097e9c75917476bd358f85340
5
5
  SHA512:
6
- metadata.gz: d0799c7fa57371400aa38bcebbeb8a7f870398f139387c5408b99506bc0f5beb6afa03b29117e4c3adc2ffa0bf2bf547b36d55b5cfd0d26424a79da608a1b020
7
- data.tar.gz: abeb053b0c13b9cf74a09f2063df8d41f0d242d048dc5486ec2fb73f7eeea69951843be5184131b8a9df19ad76512612d2cf42626264c19e43659ea4277f734a
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 (see [an example](http://sitevalidator.com/gem/report.html)).
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
- [![site_validator screencast](https://dl.dropboxusercontent.com/u/2268180/sitevalidator_gem_video.png)](https://sitevalidator.com/video_gem?autoplay=true)
7
+ [![site_validator screencast](https://dl.dropboxusercontent.com/u/2268180/sitevalidator_gem_video.png)](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
 
@@ -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, timeout = 20)
16
- @url = url
17
- @timeout = timeout
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 => ENV['W3C_MARKUP_VALIDATOR_URI'] || 'http://validator.w3.org/check',
78
- 'user-agent' => SiteValidator::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="https://sitevalidator.com">Site Validator</a>
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="http://sitevalidator.com/plans-and-pricing">Plans and pricing</a></li>
112
- <li><a href="https://sitevalidator.com/faqs">FAQs</a></li>
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="https://sitevalidator.com">Site Validator app</a>.</p>
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
 
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module SiteValidator
4
- VERSION = "1.7.4"
4
+ VERSION = "2.0.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.7.4
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-01-20 00:00:00.000000000 Z
11
+ date: 2015-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: w3c_validators