w3clove 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/w3clove/sitemap.rb +1 -1
- data/lib/w3clove/version.rb +1 -1
- data/spec/samples/international.response +21 -0
- data/spec/sitemap_spec.rb +9 -1
- data/spec/spec_helper.rb +1 -0
- metadata +106 -121
data/lib/w3clove/sitemap.rb
CHANGED
@@ -74,7 +74,7 @@ module W3Clove
|
|
74
74
|
# Tells if the given url looks like an HTML page.
|
75
75
|
# That is, it does not look like javascript, image, pdf...
|
76
76
|
def looks_like_html?(url)
|
77
|
-
u = URI.parse(url)
|
77
|
+
u = URI.parse(URI.encode(url))
|
78
78
|
scheme = u.scheme
|
79
79
|
extension = u.path.split(".").last
|
80
80
|
|
data/lib/w3clove/version.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
HTTP/1.1 200 OK
|
2
|
+
Server: nginx/0.7.67
|
3
|
+
Date: Fri, 18 Nov 2011 21:46:46 GMT
|
4
|
+
Content-Type: text/html
|
5
|
+
Connection: keep-alive
|
6
|
+
Last-Modified: Mon, 14 Nov 2011 16:53:18 GMT
|
7
|
+
Content-Length: 4987
|
8
|
+
X-Varnish: 2000423390
|
9
|
+
Age: 0
|
10
|
+
Via: 1.1 varnish
|
11
|
+
|
12
|
+
<html>
|
13
|
+
<head>
|
14
|
+
<title>Sample file with unencoded URLs in links, like international or white space</title>
|
15
|
+
</head>
|
16
|
+
<body>
|
17
|
+
<a href="http://example.com/international">index</a>
|
18
|
+
<a href="http://example.com/romanée">Romanée</a>
|
19
|
+
<a href="http://example.com/españa">España</a>
|
20
|
+
</body>
|
21
|
+
</html>
|
data/spec/sitemap_spec.rb
CHANGED
@@ -12,6 +12,7 @@ describe W3Clove::Sitemap do
|
|
12
12
|
@sitemap_with_protocol_relative_https = W3Clove::Sitemap.new('https://protocol-relative.com')
|
13
13
|
@sitemap_for_exclusions = W3Clove::Sitemap.new('http://example.com/exclusions')
|
14
14
|
@sitemap_for_absolute_urls = W3Clove::Sitemap.new('http://w3clove.com/faqs')
|
15
|
+
@sitemap_international = W3Clove::Sitemap.new('http://example.com/international')
|
15
16
|
|
16
17
|
MarkupValidator.any_instance.stubs(:validate_uri).returns(stubbed_validator_results)
|
17
18
|
end
|
@@ -104,6 +105,13 @@ describe W3Clove::Sitemap do
|
|
104
105
|
@sitemap_for_exclusions.pages[2].url.should == 'http://example.com/faqs'
|
105
106
|
end
|
106
107
|
|
108
|
+
it "should not crash when URLs have international characters" do
|
109
|
+
@sitemap_international.pages.length.should == 3
|
110
|
+
@sitemap_international.pages[0].url.should == 'http://example.com/international'
|
111
|
+
@sitemap_international.pages[1].url.should == 'http://example.com/romanée'
|
112
|
+
@sitemap_international.pages[2].url.should == 'http://example.com/españa'
|
113
|
+
end
|
114
|
+
|
107
115
|
context "protocol-relative links" do
|
108
116
|
it "should include only internal links" do
|
109
117
|
@sitemap_with_protocol_relative.pages.size.should == 3
|
@@ -143,4 +151,4 @@ describe W3Clove::Sitemap do
|
|
143
151
|
end
|
144
152
|
end
|
145
153
|
end
|
146
|
-
end
|
154
|
+
end# -*- encoding: utf-8 -*-
|
data/spec/spec_helper.rb
CHANGED
@@ -15,6 +15,7 @@ FakeWeb.register_uri(:get, "http://protocol-relative.com", :response => open("#{
|
|
15
15
|
FakeWeb.register_uri(:get, "https://protocol-relative.com", :response => open("#{$samples_dir}/protocol_relative.html").read)
|
16
16
|
FakeWeb.register_uri(:get, "http://example.com/exclusions", :response => open("#{$samples_dir}/exclusions.html").read)
|
17
17
|
FakeWeb.register_uri(:get, "http://w3clove.com/faqs", :response => open("#{$samples_dir}/w3clove_faqs.response").read)
|
18
|
+
FakeWeb.register_uri(:get, "http://example.com/international", :response => open("#{$samples_dir}/international.response").read)
|
18
19
|
|
19
20
|
def message_text(message_id)
|
20
21
|
message_texts = {
|
metadata
CHANGED
@@ -1,145 +1,138 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: w3clove
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.5
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 7
|
9
|
-
- 4
|
10
|
-
version: 0.7.4
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Jaime Iniesta
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-08-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: w3c_validators
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 2
|
32
|
-
version: "1.2"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.2'
|
33
22
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: nokogiri
|
37
23
|
prerelease: false
|
38
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.2'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: nokogiri
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
39
33
|
none: false
|
40
|
-
requirements:
|
34
|
+
requirements:
|
41
35
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: 5
|
44
|
-
segments:
|
45
|
-
- 1
|
46
|
-
- 5
|
47
|
-
- 3
|
36
|
+
- !ruby/object:Gem::Version
|
48
37
|
version: 1.5.3
|
49
38
|
type: :runtime
|
50
|
-
version_requirements: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: metainspector
|
53
39
|
prerelease: false
|
54
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.5.3
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: metainspector
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
55
49
|
none: false
|
56
|
-
requirements:
|
57
|
-
- -
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
hash: 59
|
60
|
-
segments:
|
61
|
-
- 1
|
62
|
-
- 9
|
63
|
-
- 4
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
64
53
|
version: 1.9.4
|
65
54
|
type: :runtime
|
66
|
-
version_requirements: *id003
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: rspec
|
69
55
|
prerelease: false
|
70
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
57
|
none: false
|
72
|
-
requirements:
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.9.4
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
73
67
|
- - ~>
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
hash: 27
|
76
|
-
segments:
|
77
|
-
- 2
|
78
|
-
- 5
|
79
|
-
- 0
|
68
|
+
- !ruby/object:Gem::Version
|
80
69
|
version: 2.5.0
|
81
70
|
type: :development
|
82
|
-
version_requirements: *id004
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: mocha
|
85
71
|
prerelease: false
|
86
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
87
73
|
none: false
|
88
|
-
requirements:
|
74
|
+
requirements:
|
89
75
|
- - ~>
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.5.0
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: mocha
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
96
85
|
version: 0.11.4
|
97
86
|
type: :development
|
98
|
-
version_requirements: *id005
|
99
|
-
- !ruby/object:Gem::Dependency
|
100
|
-
name: rake
|
101
87
|
prerelease: false
|
102
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
103
89
|
none: false
|
104
|
-
requirements:
|
90
|
+
requirements:
|
105
91
|
- - ~>
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 0.11.4
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rake
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
112
101
|
version: 0.9.2
|
113
102
|
type: :development
|
114
|
-
version_requirements: *id006
|
115
|
-
- !ruby/object:Gem::Dependency
|
116
|
-
name: fakeweb
|
117
103
|
prerelease: false
|
118
|
-
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
105
|
none: false
|
120
|
-
requirements:
|
106
|
+
requirements:
|
121
107
|
- - ~>
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.9.2
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: fakeweb
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
128
117
|
version: 1.3.0
|
129
118
|
type: :development
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 1.3.0
|
126
|
+
description: ! 'this tool allows you to check the markup validation of a whole site,
|
127
|
+
|
128
|
+
and outputs a detailed report with all errors and warnings'
|
129
|
+
email:
|
135
130
|
- jaimeiniesta@gmail.com
|
136
|
-
executables:
|
131
|
+
executables:
|
137
132
|
- w3clove
|
138
133
|
extensions: []
|
139
|
-
|
140
134
|
extra_rdoc_files: []
|
141
|
-
|
142
|
-
files:
|
135
|
+
files:
|
143
136
|
- .gitignore
|
144
137
|
- .rvmrc.example
|
145
138
|
- .travis.yml
|
@@ -163,6 +156,7 @@ files:
|
|
163
156
|
- spec/samples/eparreno.com.html
|
164
157
|
- spec/samples/exclusions.html
|
165
158
|
- spec/samples/guides.rubyonrails.org.html
|
159
|
+
- spec/samples/international.response
|
166
160
|
- spec/samples/protocol_relative.html
|
167
161
|
- spec/samples/sitemap.xml
|
168
162
|
- spec/samples/w3clove_faqs.response
|
@@ -172,36 +166,27 @@ files:
|
|
172
166
|
- w3clove.gemspec
|
173
167
|
homepage: https://github.com/jaimeiniesta/w3clove/
|
174
168
|
licenses: []
|
175
|
-
|
176
169
|
post_install_message:
|
177
170
|
rdoc_options: []
|
178
|
-
|
179
|
-
require_paths:
|
171
|
+
require_paths:
|
180
172
|
- lib
|
181
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
182
174
|
none: false
|
183
|
-
requirements:
|
184
|
-
- -
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
|
187
|
-
|
188
|
-
- 0
|
189
|
-
version: "0"
|
190
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ! '>='
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: '0'
|
179
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
180
|
none: false
|
192
|
-
requirements:
|
193
|
-
- -
|
194
|
-
- !ruby/object:Gem::Version
|
195
|
-
|
196
|
-
segments:
|
197
|
-
- 0
|
198
|
-
version: "0"
|
181
|
+
requirements:
|
182
|
+
- - ! '>='
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '0'
|
199
185
|
requirements: []
|
200
|
-
|
201
186
|
rubyforge_project:
|
202
|
-
rubygems_version: 1.8.
|
187
|
+
rubygems_version: 1.8.24
|
203
188
|
signing_key:
|
204
189
|
specification_version: 3
|
205
|
-
summary: command-line tool to validate the markup of a whole site against the W3C
|
190
|
+
summary: command-line tool to validate the markup of a whole site against the W3C
|
191
|
+
validator
|
206
192
|
test_files: []
|
207
|
-
|