site_validator 1.6.0 → 1.7.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: 2fab4f67e2f1341e0656b48eb217dfaa61a22ccb
4
- data.tar.gz: f36945fd0211036d946318bb7bd36723ff176e49
3
+ metadata.gz: cfedc64db42ded555575fcfaf6282834066b1be6
4
+ data.tar.gz: af7c264b7b7fb7b7a5bbe645080fa1fe95ca618b
5
5
  SHA512:
6
- metadata.gz: ec86f6394169530bb09a5e7870191a3db67e8e7548cd60e0ccd141166fdf2bd4f2288f4b93d9d14bd96e35085044d2b6a7b3aebb922efc2a88072370981abd6d
7
- data.tar.gz: 78aea8f25c20ecaba88a7025d3325a904cd404ec4096812107b6c82b221ff2bb59f49c16f4929c398049f08b63eb8bd4fe7b0a8da1076e848a800249ef90cd9a
6
+ metadata.gz: 35593b655bb9b26926b6dd454844ed8e319330bfb7916c98a76c076b458b384e5ee2d081e330fd31c7d5cdb8be5ff027f33021d9e05be6bb964bf3e0f08b7f39
7
+ data.tar.gz: c6fd3276a427573f945e42f3b98be1ff93db4a23bdc6804414209067646e67988c17acd50a0c684a1579dd5f6863869c1f515109d5138fee6d7fb5b217fc4014
data/.travis.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  rvm:
2
- - 1.9.3
3
- - 2.1.2
2
+ - 2.0.0
3
+ - 2.1.3
data/README.md CHANGED
@@ -52,7 +52,7 @@ More info about the `user-agent` option on the W3C Validator can be found [here]
52
52
 
53
53
  ##Notes:
54
54
 
55
- This gem is tested on Ruby 1.9.3 and 2.1.2.
55
+ This gem is tested on Ruby 2.0.0 and 2.1.3.
56
56
 
57
57
  ##License:
58
58
 
@@ -54,7 +54,7 @@ module SiteValidator
54
54
  pages = xml_locations.select {|loc| looks_like_html?(loc.text.strip)}.map {|loc| SiteValidator::Page.new(loc.text.strip)}
55
55
 
56
56
  if pages.empty?
57
- m = MetaInspector.new(url, :timeout => 20, :allow_redirections => :all, :headers => {'User-Agent' => SiteValidator::USER_AGENT})
57
+ m = scraped_doc
58
58
  links = [m.url]
59
59
 
60
60
  m.internal_links.select {|l| looks_like_html?(l)}.map {|l| l.split('#')[0]}.uniq.each do |link|
@@ -86,8 +86,12 @@ module SiteValidator
86
86
  Nokogiri::XML(doc).css('loc')
87
87
  end
88
88
 
89
+ def scraped_doc
90
+ @scraped_doc ||= MetaInspector.new(url, :headers => {'User-Agent' => SiteValidator::USER_AGENT})
91
+ end
92
+
89
93
  def doc
90
- @doc ||= open(url, "User-Agent" => SiteValidator::USER_AGENT, :allow_redirections => :all)
94
+ @doc ||= scraped_doc.to_s
91
95
  end
92
96
  end
93
97
  end
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module SiteValidator
4
- VERSION = "1.6.0"
4
+ VERSION = "1.7.0"
5
5
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
 
19
19
  gem.add_dependency 'w3c_validators', '~> 1.2'
20
20
  gem.add_dependency 'nokogiri', '~> 1.6.0'
21
- gem.add_dependency 'metainspector', '~> 2.2.1'
21
+ gem.add_dependency 'metainspector', '~> 3.1.0'
22
22
 
23
23
  gem.add_development_dependency 'rspec', '~> 2.14.1'
24
24
  gem.add_development_dependency 'mocha', '~> 0.11.4'
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.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: 2014-09-02 00:00:00.000000000 Z
11
+ date: 2014-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: w3c_validators
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.6.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.6.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: metainspector
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.2.1
47
+ version: 3.1.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.2.1
54
+ version: 3.1.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.14.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.14.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mocha
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.11.4
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.11.4
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 10.1.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 10.1.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: fakeweb
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: 1.3.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.3.0
111
111
  description: command-line tool to validate the markup of a whole site against the
@@ -117,10 +117,10 @@ executables:
117
117
  extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
- - .gitignore
121
- - .rspec
122
- - .rvmrc.example
123
- - .travis.yml
120
+ - ".gitignore"
121
+ - ".rspec"
122
+ - ".rvmrc.example"
123
+ - ".travis.yml"
124
124
  - Gemfile
125
125
  - MIT-LICENSE
126
126
  - README.md
@@ -166,12 +166,12 @@ require_paths:
166
166
  - lib
167
167
  required_ruby_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - ! '>='
169
+ - - ">="
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  requirements:
174
- - - ! '>='
174
+ - - ">="
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  requirements: []