w3clove 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +0 -2
- data/lib/w3clove/sitemap.rb +11 -3
- data/lib/w3clove/version.rb +1 -1
- data/spec/samples/w3clove_faqs.response +266 -0
- data/spec/sitemap_spec.rb +32 -10
- data/spec/spec_helper.rb +1 -0
- data/w3clove.gemspec +1 -1
- metadata +9 -7
data/README.rdoc
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
= w3clove {<img src="http://travis-ci.org/jaimeiniesta/w3clove.png" />}[http://travis-ci.org/jaimeiniesta/w3clove]
|
2
|
-
|
3
1
|
Site-wide markup validator. Validate a whole web site on the W3C Markup Validator, from the command line, and generate a comprehensive report of all errors found.
|
4
2
|
|
5
3
|
This is the command-line version of http://w3clove.com
|
data/lib/w3clove/sitemap.rb
CHANGED
@@ -49,15 +49,23 @@ module W3Clove
|
|
49
49
|
# It first assumes it's an XML sitemap; if no locations found, it will try to
|
50
50
|
# scrape the links from HTML.
|
51
51
|
#
|
52
|
-
# For HTML sources, it will only get the links that start with the sitemap url, convert relative links
|
52
|
+
# For HTML sources, it will only get the links that start with the sitemap root url, convert relative links
|
53
53
|
# to absolute links, remove anchors from links, include the sitemap url, and exclude links that don't
|
54
54
|
# seem to point to HTML (like images, multimedia, text, javascript...)
|
55
55
|
def pages_in_sitemap
|
56
56
|
pages = xml_locations.map {|loc| W3Clove::Page.new(loc.text)}
|
57
57
|
if pages.empty?
|
58
58
|
m = MetaInspector.new(url, timeout)
|
59
|
-
links = m.
|
60
|
-
|
59
|
+
links = [m.url]
|
60
|
+
|
61
|
+
m.links.select {|l| l.start_with?(m.root_url) && looks_like_html?(l)}.map {|l| l.split('#')[0]}.uniq.each do |link|
|
62
|
+
if link[-1,1] == "/"
|
63
|
+
links << link unless (links.include?(link) || links.include?(link.chop))
|
64
|
+
else
|
65
|
+
links << link unless (links.include?(link) || links.include?("#{link}/"))
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
61
69
|
pages = links.map {|link| W3Clove::Page.new(link)}
|
62
70
|
end
|
63
71
|
pages
|
data/lib/w3clove/version.rb
CHANGED
@@ -0,0 +1,266 @@
|
|
1
|
+
HTTP/1.1 200 OK
|
2
|
+
Server: nginx
|
3
|
+
Date: Mon, 23 Jul 2012 08:44:12 GMT
|
4
|
+
Content-Type: text/html; charset=utf-8
|
5
|
+
Connection: keep-alive
|
6
|
+
Status: 200 OK
|
7
|
+
X-Ua-Compatible: IE=Edge,chrome=1
|
8
|
+
Etag: "c4f3d4aaf12acce6a909714618e08934"
|
9
|
+
Cache-Control: max-age=0, private, must-revalidate
|
10
|
+
Set-Cookie: _w3clovesite_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTJiMWU0NzVkNjJjNDliMDRlZGI3MjI5OTVlN2U4MjU5BjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMTlWUmVSMEVlTWNuV0t4cTFuNHUvQVozZCttMjhxRTEvWFhYYW5hOXRFdUk9BjsARg%3D%3D--7e9d3e900c9531363297f469f8baa3e3ed31336a; path=/; HttpOnly
|
11
|
+
X-Request-Id: 33ca78a4044d244e673d273a59fa4ebc
|
12
|
+
X-Runtime: 0.017688
|
13
|
+
X-Rack-Cache: miss
|
14
|
+
Content-Length: 12923
|
15
|
+
X-Varnish: 647613022
|
16
|
+
Age: 0
|
17
|
+
Via: 1.1 varnish
|
18
|
+
|
19
|
+
<!DOCTYPE html>
|
20
|
+
<html>
|
21
|
+
|
22
|
+
<head><script type="text/javascript">var NREUMQ=NREUMQ||[];NREUMQ.push(["mark","firstbyte",new Date().getTime()]);</script>
|
23
|
+
<meta charset="UTF-8" />
|
24
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
25
|
+
<title>Whole site HTML validator | W3CLove</title>
|
26
|
+
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
|
27
|
+
<meta name="description" content="Site-wide markup validation tool. Validate the markup of your whole site with just one click." />
|
28
|
+
<meta name="keywords" content="html, markup, validation, validator, tool, w3c, development, standards, free" />
|
29
|
+
<link href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
|
30
|
+
<link href="http://fonts.googleapis.com/css?family=Terminal+Dosis:400,600" rel="stylesheet" type="text/css" />
|
31
|
+
<link href="/assets/application-9da2f67bc1bc6e19a801cb7685a0b497.css" media="screen" rel="stylesheet" type="text/css" />
|
32
|
+
<meta content="authenticity_token" name="csrf-param" />
|
33
|
+
<meta content="9VReR0EeMcnWKxq1n4u/AZ3d+m28qE1/XXXana9tEuI=" name="csrf-token" />
|
34
|
+
<script src="/assets/application-4e8aa1a929a0aeab6bdf339edecbeaa6.js" type="text/javascript"></script>
|
35
|
+
<script src="/assets/pages-7270767b2a9e9fff880aa5de378ca791.js" type="text/javascript"></script>
|
36
|
+
<script src="https://apis.google.com/js/plusone.js" type="text/javascript"></script>
|
37
|
+
|
38
|
+
<script type="text/javascript">
|
39
|
+
|
40
|
+
var _gaq = _gaq || [];
|
41
|
+
_gaq.push(['_setAccount', 'UA-122379-37']);
|
42
|
+
_gaq.push(['_trackPageview']);
|
43
|
+
|
44
|
+
(function() {
|
45
|
+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
46
|
+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
47
|
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
48
|
+
})();
|
49
|
+
|
50
|
+
</script>
|
51
|
+
</head>
|
52
|
+
|
53
|
+
<body>
|
54
|
+
|
55
|
+
<div id="flash_message"><div><span id="flash_message_text"></span><a class="close-message" href="#" onclick="closeMsgBar();">X</a></div></div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
<div class="row top-bar">
|
60
|
+
<div class="content">
|
61
|
+
<header>
|
62
|
+
<div class="header">
|
63
|
+
<h1><a href="/" title="W3CLove">W3CLove</a></h1>
|
64
|
+
<nav>
|
65
|
+
<a href="#" class="nav_button"></a>
|
66
|
+
<ul class="nav">
|
67
|
+
<li><a href="/faqs" class='active'>FAQs</a></li>
|
68
|
+
<li><a href="/plans-and-pricing" >Plans and pricing</a></li>
|
69
|
+
<li><a href="/contact" >Contact</a></li>
|
70
|
+
<li><a href="/charts/errors" >Top 100 Errors</a></li>
|
71
|
+
</ul>
|
72
|
+
</nav>
|
73
|
+
|
74
|
+
|
75
|
+
<div id="sign_in">
|
76
|
+
<a href="/credits" class="label warning" id="credits_count">10 Credits</a>
|
77
|
+
|
78
|
+
<a href="/signin" class="label success">Sign in</a>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
</header>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="faqs" class="row hero">
|
86
|
+
|
87
|
+
<div class="content">
|
88
|
+
|
89
|
+
<h2>FAQs</h2>
|
90
|
+
<h3>Frequently Asked Questions</h3>
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
|
97
|
+
<div class="row description">
|
98
|
+
|
99
|
+
<div class="content">
|
100
|
+
|
101
|
+
<h4 id="what_is_w3clove">What is W3CLove?</h4>
|
102
|
+
<p>
|
103
|
+
W3CLove is a site-wide markup validation tool. It allows you to check the validity of the markup of several pages
|
104
|
+
from your website, and gives you a summary of the most common errors and warnings, with a single click.
|
105
|
+
</p>
|
106
|
+
|
107
|
+
<h4 id="why_not_just_use_the_official_w3c_validator">Why not just use the official W3C validator?</h4>
|
108
|
+
<p>
|
109
|
+
The <a href="http://validator.w3.org">official W3C validator</a> does not yet provide a way to submit several URLs at once. So, if you want to check your whole
|
110
|
+
website, you need to submit each of your URLs individually, which is a slow process. W3CLove provides a simpler, faster way to
|
111
|
+
submit several pages at once.
|
112
|
+
</p>
|
113
|
+
|
114
|
+
<h4 id="how_can_i_submit_my_site_for_validation">How can I submit a site for validation?</h4>
|
115
|
+
<p>
|
116
|
+
To submit a site, just enter its URL on the <a href="/">front page</a>, and click the "Validate" button. The W3CLove spider will crawl the site
|
117
|
+
in search for internal links, validate each of them, and then compile all errors and warnings in one summary.
|
118
|
+
</p>
|
119
|
+
|
120
|
+
<h4 id="how_can_i_specify_the_exact_urls_i_want_to_validate">How can I specify the exact URLs I want to validate?</h4>
|
121
|
+
<p>
|
122
|
+
The W3CLove spider will crawl the provided URL in search for internal links, but you can also provide an <a href="http://www.sitemaps.org/">XML sitemap</a> with the exact URLs
|
123
|
+
you need to validate.
|
124
|
+
</p>
|
125
|
+
|
126
|
+
<h4 id="is_there_a_limit_on_the_number_of_urls">Is there a limit on the number of URLs to validate?</h4>
|
127
|
+
<p>
|
128
|
+
Yes, there is a limit of 250 URLs per each sitemap submitted. This should be enough for most sites to get a good idea of the
|
129
|
+
validation status of the site, and saves processing time for both W3CLove and the W3C validator.
|
130
|
+
</p>
|
131
|
+
|
132
|
+
<h4 id="how_can_i_resubmit_a_site">How can I resubmit a site?</h4>
|
133
|
+
<p>
|
134
|
+
Just click on the "Re-check" buttons. You can recheck the whole sitemap or individual pages.
|
135
|
+
</p>
|
136
|
+
|
137
|
+
<h4 id="can_i_store_my_sitemaps_list">Can I store my sitemaps list?</h4>
|
138
|
+
<p>
|
139
|
+
Yes, W3CLove lets you store for free a list of the sitemaps you're interested in validating. Just sign in with your Twitter, Facebook or Google account and every sitemap you validate will appear on your sitemaps list.
|
140
|
+
</p>
|
141
|
+
|
142
|
+
<h4 id="how_do_credits_work">How do credits work?</h4>
|
143
|
+
<p>
|
144
|
+
When you sign up for the first time at W3CLove, you're given 100 initial credits so you can try the service for free.
|
145
|
+
</p>
|
146
|
+
<p>
|
147
|
+
For every single web page validation that you make using our service, you're charged 1 credit. So, for example, if you start with 100 credits and you validate a site that has 30 web pages, you end up with 70 credits.
|
148
|
+
</p>
|
149
|
+
<p>
|
150
|
+
Once you spend all your credits, you can't make more validations until you recharge them.
|
151
|
+
</p>
|
152
|
+
|
153
|
+
<h4 id="how_can_i_recharge_my_credits">How can I recharge my credits?</h4>
|
154
|
+
<p>
|
155
|
+
The easiest way to recharge your credits is through a monthly subscription.
|
156
|
+
</p>
|
157
|
+
<p>
|
158
|
+
This way, your credits will be recharged every month up to the monthly limit of your chosen plan.
|
159
|
+
</p>
|
160
|
+
<p>
|
161
|
+
Check out the <a href="/plans-and-pricing">Plans and pricing</a> page to see what plan is best for you. If you're not sure about how many validations you need, you can buy packs of validations.
|
162
|
+
</p>
|
163
|
+
|
164
|
+
<h4 id="how_can_i_sign_in_with_another_account">I've signed in from one account, how can I sign in with a different one?</h4>
|
165
|
+
<p>
|
166
|
+
For your convenience, you're first shown 3 ways to sign in: Twitter, Facebook and Google. When you use one of those, W3CLove will remember your preference and offer just this one.
|
167
|
+
</p>
|
168
|
+
<p>
|
169
|
+
If you'd like to change this preference, just sign in again with your preferred account:<br/>
|
170
|
+
<a href='#' onclick='window.location="/auth/twitter"; return false;' style='color:white;'><span class='label success'>twitter</span></a>, <a href='#' onclick='window.location="/auth/facebook"; return false;' style='color:white;'><span class='label success'>facebook</span></a> or <a href='#' onclick='window.location="/auth/google_oauth2"; return false;' style='color:white;'><span class='label success'>google</span></a>.
|
171
|
+
</p>
|
172
|
+
|
173
|
+
<h4 id="who_is_behind_all_this">Who is behind all this?</h4>
|
174
|
+
<p>
|
175
|
+
W3CLove is a personal project maintained by <a href="http://jaimeiniesta.com/">Jaime Iniesta</a>, an independent web developer who loves working with Ruby on Rails. That's me. :)
|
176
|
+
</p>
|
177
|
+
|
178
|
+
<h4 id="how_did_this_project_start">How did this project start?</h4>
|
179
|
+
<p>
|
180
|
+
During March 2011 I took the Ruby Core Skills course at the <a href="http://mendicantuniversity.org/">Mendicant University</a>, an intense three week course that takes you through several important topic areas every Ruby developer should be comfortable on. You can <a href="http://jaimeiniesta.posterous.com/rbmu-a-better-way-to-learn-ruby">read more</a> about it at my blog.
|
181
|
+
</p>
|
182
|
+
<p>
|
183
|
+
With the help of <a href="http://majesticseacreature.com/">Gregory Brown</a> and the rest of the <a href="http://school.mendicantuniversity.org/alumni/2011">Mendicant University Alumni</a>, I built the <a href="https://github.com/jaimeiniesta/w3clove">w3clove</a> gem that allows you to do site-wide markup validation from the command line.
|
184
|
+
</p>
|
185
|
+
<p>
|
186
|
+
Afterwards, I built this <a href="http://w3clove.com">W3CLove.com</a> site to make it easier for everyone to do site-wide markup validation, with a nicer HTML interface, storing the results for later, rechecking, etc.
|
187
|
+
</p>
|
188
|
+
<p>
|
189
|
+
I want to express my gratitude to all the Mendicant University community, all of them are still helping me making W3CLove a better tool for everyone. Thank you!
|
190
|
+
</p>
|
191
|
+
|
192
|
+
<h4 id="is_this_free">Is this free?</h4>
|
193
|
+
<p>
|
194
|
+
No, this is a paid service, but you can try it for free.
|
195
|
+
</p>
|
196
|
+
|
197
|
+
<h4 id="is_there_an_open_source_version">Is there an open source version?</h4>
|
198
|
+
<p>
|
199
|
+
Yes! There's a free, standalone version that you can install on your computer. It's packed as a Ruby gem and it's open source, so you can examine the code and contribute to it if you wish.
|
200
|
+
</p>
|
201
|
+
<p>
|
202
|
+
You can find the <a href="https://github.com/jaimeiniesta/w3clove">w3clove gem at Github</a>.
|
203
|
+
</p>
|
204
|
+
|
205
|
+
<h4 id="is_there_an_api">Is there an API?</h4>
|
206
|
+
<p>
|
207
|
+
Yes! I've started building an API. It's not finished yet, but you can already validate sitemaps and pages with it. Read more about it at the <a href="/api_v1_reference">API V1 Reference</a> page.
|
208
|
+
</p>
|
209
|
+
|
210
|
+
</div>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
|
214
|
+
<div class="row footer">
|
215
|
+
<div class="content">
|
216
|
+
<footer>
|
217
|
+
<p>
|
218
|
+
<!-- Begin MailChimp Signup Form -->
|
219
|
+
<div id="mc_embed_signup">
|
220
|
+
<form action="http://w3clove.us4.list-manage.com/subscribe/post?u=6af3ab69c286561d0f0f25671&id=04a0dab609" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate shadowins">
|
221
|
+
<label for="mce-EMAIL">Subscribe to our newsletter:</label>
|
222
|
+
<input type="email" value="your email" name="EMAIL" class="email" id="mce-EMAIL" placeholder="your email" onfocus="this.value='';" required>
|
223
|
+
<div class="clear"><input type="submit" value="♥" name="subscribe" id="mc-embedded-subscribe" class="button btn"></div>
|
224
|
+
</form>
|
225
|
+
</div>
|
226
|
+
<!--End mc_embed_signup-->
|
227
|
+
|
228
|
+
<ul class="social_share">
|
229
|
+
<li class="twitter_follow"><a href="https://twitter.com/w3clove" class="twitter-follow-button" data-button="grey" data-text-color="#FFFFFF" data-link-color="#999999" data-show-count="false">Follow</a></li>
|
230
|
+
<li class="tweets_count"><a href="http://twitter.com/share" style="display:block;" class="twitter-share-button" data-count="horizontal" data-via="w3clove" data-lang="en">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></li>
|
231
|
+
<li class="gplus_count"><div class="g-plusone" data-size="medium" data-count="true"></div></li>
|
232
|
+
</ul>
|
233
|
+
</p>
|
234
|
+
<p class="clearb"><strong>W3CLove</strong> lets you <strong>validate entire sites</strong> with one click. This is an independent project, not associated with the W3C. By making use of this website you agree to the <a href="/terms_of_service">Terms of service</a>.<br /><br />Follow us on <a href="http://twitter.com/W3CLove">Twitter</a> and <a href="http://us4.campaign-archive1.com/home/?u=6af3ab69c286561d0f0f25671&id=04a0dab609">subscribe to our monthly newsletter</a>.</p>
|
235
|
+
</footer>
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<script type="text/javascript">
|
240
|
+
var uvOptions = {};
|
241
|
+
(function() {
|
242
|
+
var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true;
|
243
|
+
uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/nhy6YD24GjgADgFX3h5z4w.js';
|
244
|
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s);
|
245
|
+
})();
|
246
|
+
</script>
|
247
|
+
<script type="text/javascript">
|
248
|
+
//<![CDATA[
|
249
|
+
|
250
|
+
var menuVisible = false;
|
251
|
+
$('.nav_button').on('click', showHideMenu);
|
252
|
+
|
253
|
+
//]]>
|
254
|
+
</script>
|
255
|
+
|
256
|
+
<script type="text/javascript">if (!NREUMQ.f) { NREUMQ.f=function() {
|
257
|
+
NREUMQ.push(["load",new Date().getTime()]);
|
258
|
+
var e=document.createElement("script");
|
259
|
+
e.type="text/javascript";e.async=true;e.src="https://d1ros97qkrwjf5.cloudfront.net/39/eum/rum.js";
|
260
|
+
document.body.appendChild(e);
|
261
|
+
if(NREUMQ.a)NREUMQ.a();
|
262
|
+
};
|
263
|
+
NREUMQ.a=window.onload;window.onload=NREUMQ.f;
|
264
|
+
};
|
265
|
+
NREUMQ.push(["nrfj","beacon-1.newrelic.com","96fc3f1db6",415027,"c1hbQUcNWlhQQhsNWVdfakNaDkJVUlUbFVFXUkYaRgpZQw==",0.0,14,new Date().getTime(),"","","","",""])</script></body>
|
266
|
+
</html>
|
data/spec/sitemap_spec.rb
CHANGED
@@ -11,6 +11,7 @@ describe W3Clove::Sitemap do
|
|
11
11
|
@sitemap_with_protocol_relative = W3Clove::Sitemap.new('http://protocol-relative.com')
|
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
|
+
@sitemap_for_absolute_urls = W3Clove::Sitemap.new('http://w3clove.com/faqs')
|
14
15
|
|
15
16
|
MarkupValidator.any_instance.stubs(:validate_uri).returns(stubbed_validator_results)
|
16
17
|
end
|
@@ -28,10 +29,10 @@ describe W3Clove::Sitemap do
|
|
28
29
|
end
|
29
30
|
|
30
31
|
it "should get pages from the sample guides.rubyonrails.org site" do
|
31
|
-
|
32
|
+
#@sitemap_html.pages.length.should == 34
|
32
33
|
@sitemap_html.pages.map {|p| p.url}
|
33
|
-
.should == ["http://guides.rubyonrails.org
|
34
|
-
"http://guides.rubyonrails.org/",
|
34
|
+
.should == ["http://guides.rubyonrails.org",
|
35
|
+
"http://guides.rubyonrails.org/index.html",
|
35
36
|
"http://guides.rubyonrails.org/getting_started.html",
|
36
37
|
"http://guides.rubyonrails.org/migrations.html",
|
37
38
|
"http://guides.rubyonrails.org/active_record_validations_callbacks.html",
|
@@ -65,27 +66,48 @@ describe W3Clove::Sitemap do
|
|
65
66
|
"http://guides.rubyonrails.org/v2.3.8/"]
|
66
67
|
end
|
67
68
|
|
69
|
+
it "should get correct absolute links for internal pages" do
|
70
|
+
@sitemap_for_absolute_urls.pages.length.should == 9
|
71
|
+
@sitemap_for_absolute_urls.pages.map {|p| p.url}
|
72
|
+
.should == ["http://w3clove.com/faqs",
|
73
|
+
"http://w3clove.com/",
|
74
|
+
"http://w3clove.com/plans-and-pricing",
|
75
|
+
"http://w3clove.com/contact",
|
76
|
+
"http://w3clove.com/charts/errors",
|
77
|
+
"http://w3clove.com/credits",
|
78
|
+
"http://w3clove.com/signin",
|
79
|
+
"http://w3clove.com/api_v1_reference",
|
80
|
+
"http://w3clove.com/terms_of_service"]
|
81
|
+
end
|
82
|
+
|
68
83
|
it "should include sitemap url at least, even if no links were found" do
|
69
84
|
@sitemap_no_links.pages.length.should == 1
|
70
85
|
@sitemap_no_links.pages[0].url.should == 'http://zigotica.com'
|
71
86
|
end
|
72
87
|
|
73
|
-
it "should not repeat
|
88
|
+
it "should not repeat sitemap URL with and without trailing slash" do
|
74
89
|
urls = @sitemap_with_trailing_slash.pages.collect(&:url)
|
75
|
-
urls.should include 'http://eparreno.com
|
76
|
-
urls.should_not include 'http://eparreno.com'
|
90
|
+
urls.should include 'http://eparreno.com'
|
91
|
+
urls.should_not include 'http://eparreno.com/'
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should not repeat internal URLs with and without trailing slash" do
|
95
|
+
urls = @sitemap_for_absolute_urls.pages.collect(&:url)
|
96
|
+
urls.should include 'http://w3clove.com/faqs'
|
97
|
+
urls.should_not include 'http://w3clove.com/faqs/'
|
77
98
|
end
|
78
99
|
|
79
100
|
it "should exclude non-html pages" do
|
80
|
-
@sitemap_for_exclusions.pages.length.should ==
|
81
|
-
@sitemap_for_exclusions.pages.
|
82
|
-
@sitemap_for_exclusions.pages.
|
101
|
+
@sitemap_for_exclusions.pages.length.should == 3
|
102
|
+
@sitemap_for_exclusions.pages[0].url.should == 'http://example.com/exclusions'
|
103
|
+
@sitemap_for_exclusions.pages[1].url.should == 'http://example.com/'
|
104
|
+
@sitemap_for_exclusions.pages[2].url.should == 'http://example.com/faqs'
|
83
105
|
end
|
84
106
|
|
85
107
|
context "protocol-relative links" do
|
86
108
|
it "should include only internal links" do
|
87
109
|
@sitemap_with_protocol_relative.pages.size.should == 3
|
88
|
-
@sitemap_with_protocol_relative.pages.map {|p| p.url}.sort.should == ['http://protocol-relative.com
|
110
|
+
@sitemap_with_protocol_relative.pages.map {|p| p.url}.sort.should == ['http://protocol-relative.com',
|
89
111
|
'http://protocol-relative.com/contact',
|
90
112
|
'http://protocol-relative.com/faqs']
|
91
113
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -14,6 +14,7 @@ FakeWeb.register_uri(:get, "http://zigotica.com", :response => open("#{$samples_
|
|
14
14
|
FakeWeb.register_uri(:get, "http://protocol-relative.com", :response => open("#{$samples_dir}/protocol_relative.html").read)
|
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
|
+
FakeWeb.register_uri(:get, "http://w3clove.com/faqs", :response => open("#{$samples_dir}/w3clove_faqs.response").read)
|
17
18
|
|
18
19
|
def message_text(message_id)
|
19
20
|
message_texts = {
|
data/w3clove.gemspec
CHANGED
@@ -18,7 +18,7 @@ and outputs a detailed report with all errors and warnings}
|
|
18
18
|
|
19
19
|
gem.add_dependency 'w3c_validators', '~> 1.2'
|
20
20
|
gem.add_dependency 'nokogiri', '~> 1.5.3'
|
21
|
-
gem.add_dependency 'metainspector', '
|
21
|
+
gem.add_dependency 'metainspector', '1.9.4'
|
22
22
|
|
23
23
|
gem.add_development_dependency 'rspec', '~> 2.5.0'
|
24
24
|
gem.add_development_dependency 'mocha', '~> 0.11.4'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: w3clove
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 4
|
10
|
+
version: 0.7.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jaime Iniesta
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-07-
|
18
|
+
date: 2012-07-23 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: w3c_validators
|
@@ -54,13 +54,14 @@ dependencies:
|
|
54
54
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
55
|
none: false
|
56
56
|
requirements:
|
57
|
-
- -
|
57
|
+
- - "="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
hash:
|
59
|
+
hash: 59
|
60
60
|
segments:
|
61
61
|
- 1
|
62
62
|
- 9
|
63
|
-
|
63
|
+
- 4
|
64
|
+
version: 1.9.4
|
64
65
|
type: :runtime
|
65
66
|
version_requirements: *id003
|
66
67
|
- !ruby/object:Gem::Dependency
|
@@ -164,6 +165,7 @@ files:
|
|
164
165
|
- spec/samples/guides.rubyonrails.org.html
|
165
166
|
- spec/samples/protocol_relative.html
|
166
167
|
- spec/samples/sitemap.xml
|
168
|
+
- spec/samples/w3clove_faqs.response
|
167
169
|
- spec/samples/zigotica.com.html
|
168
170
|
- spec/sitemap_spec.rb
|
169
171
|
- spec/spec_helper.rb
|