w3clove 0.5.1 → 0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +6 -2
- data/lib/w3clove/templates/w3clove.html.erb +146 -108
- data/lib/w3clove/version.rb +1 -1
- data/w3clove.gemspec +6 -6
- metadata +10 -11
data/README.rdoc
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
= w3clove
|
1
|
+
= w3clove {<img src="http://travis-ci.org/jaimeiniesta/w3clove.png" />}[http://travis-ci.org/jaimeiniesta/w3clove]
|
2
2
|
|
3
|
-
|
3
|
+
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
|
+
|
5
|
+
This is the command-line version of http://w3clove.com
|
6
|
+
|
7
|
+
http://w3clove.com/images/w3clove_gem.png
|
4
8
|
|
5
9
|
= Installation:
|
6
10
|
|
@@ -3,137 +3,175 @@
|
|
3
3
|
<head>
|
4
4
|
<meta charset=utf-8>
|
5
5
|
<title>W3Clove report for <%= @url %></title>
|
6
|
-
<link href=
|
6
|
+
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
|
7
|
+
|
7
8
|
<style type="text/css">
|
8
|
-
|
9
|
-
|
9
|
+
/* Override some defaults */
|
10
|
+
html, body {
|
10
11
|
background-color: #eee;
|
11
|
-
border: 1px solid black;
|
12
12
|
}
|
13
|
-
|
14
|
-
|
13
|
+
body {
|
14
|
+
padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */
|
15
15
|
}
|
16
|
-
|
17
|
-
|
16
|
+
.container > footer p {
|
17
|
+
text-align: center; /* center align it with the container */
|
18
18
|
}
|
19
|
-
|
20
|
-
|
21
|
-
text-align: center;
|
19
|
+
.container {
|
20
|
+
width: 820px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
|
22
21
|
}
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
background-color:
|
22
|
+
|
23
|
+
/* The white background content wrapper */
|
24
|
+
.content {
|
25
|
+
background-color: #fff;
|
26
|
+
padding: 20px;
|
27
|
+
margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
|
28
|
+
-webkit-border-radius: 0 0 6px 6px;
|
29
|
+
-moz-border-radius: 0 0 6px 6px;
|
30
|
+
border-radius: 0 0 6px 6px;
|
31
|
+
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
32
|
+
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
33
|
+
box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
27
34
|
}
|
28
|
-
|
29
|
-
|
35
|
+
|
36
|
+
/* Page header tweaks */
|
37
|
+
.page-header {
|
38
|
+
background-color: #f5f5f5;
|
39
|
+
padding: 20px 20px 10px;
|
40
|
+
margin: -20px -20px 20px;
|
41
|
+
}
|
42
|
+
|
43
|
+
/* Give a quick and non-cross-browser friendly divider */
|
44
|
+
.content .span4 {
|
45
|
+
margin-left: 0;
|
46
|
+
padding-left: 19px;
|
47
|
+
border-left: 1px solid #eee;
|
48
|
+
}
|
49
|
+
|
50
|
+
.topbar .btn {
|
51
|
+
border: 0;
|
52
|
+
}
|
53
|
+
|
30
54
|
</style>
|
31
55
|
</head>
|
32
56
|
<body>
|
33
|
-
<div
|
34
|
-
|
57
|
+
<div class="topbar">
|
58
|
+
<div class="fill">
|
59
|
+
<div class="container">
|
60
|
+
<a class="brand" href="http://w3clove.com"><strong>W3C<span style="color:pink;">love</span></strong></a>
|
61
|
+
<ul class="nav" data-dropdown="dropdown" >
|
62
|
+
<li><a href="http://w3clove.com/faqs">FAQs</a></li>
|
63
|
+
<li><a href="http://w3clove.com/contact">Contact</a></li>
|
64
|
+
<li><a href="http://w3clove.com/donate">Donate</a></li>
|
65
|
+
<li><a href="http://w3clove.com/supporters">Supporters</a></li>
|
66
|
+
</ul>
|
67
|
+
</div>
|
68
|
+
</div>
|
35
69
|
</div>
|
36
70
|
|
37
|
-
<div
|
38
|
-
<
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<
|
50
|
-
<% errors.select{|e| e.message_id == 'html5'}
|
51
|
-
.group_by {|e| e.text}
|
52
|
-
.sort_by {|m,e| e.length}
|
53
|
-
.reverse.each do |text, errors| %>
|
54
|
-
<li><%= errors.length %> times: <strong><%= text %></strong></li>
|
55
|
-
<% end %>
|
56
|
-
</ul>
|
57
|
-
</li>
|
58
|
-
<% elsif message_id %>
|
59
|
-
<li>error <a href="http://validator.w3.org/docs/errors.html#ve-<%= message_id %>"><%= message_id %></a>
|
60
|
-
happens <%= errors.length %> times</li>
|
61
|
-
<% end %>
|
62
|
-
<% end %>
|
63
|
-
</ul>
|
64
|
-
<% end %>
|
65
|
-
|
66
|
-
<% if warnings.length > 0 %>
|
67
|
-
<h2>POPULAR WARNINGS</h2>
|
68
|
-
<ul>
|
69
|
-
<% warnings.group_by {|w| w.message_id}.sort_by {|m,w| w.length}.reverse.each do |message_id, warnings| %>
|
70
|
-
<% if message_id == 'html5' %>
|
71
|
-
<li><%= warnings.length %> HTML5 warnings found</li>
|
72
|
-
<li>
|
73
|
-
<ul>
|
74
|
-
<% warnings.select{|w| w.message_id == 'html5'}
|
75
|
-
.group_by {|w| w.text}
|
76
|
-
.sort_by {|m,w| w.length}
|
77
|
-
.reverse.each do |text, warnings| %>
|
78
|
-
<li><%= warnings.length %> times: <strong><%= text %></strong></li>
|
79
|
-
<% end %>
|
80
|
-
</ul>
|
81
|
-
</li>
|
82
|
-
<% elsif message_id %>
|
83
|
-
<li>warning <a href="http://validator.w3.org/docs/errors.html#ve-<%= message_id %>"><%= message_id %></a>
|
84
|
-
found <%= warnings.length %> times</li>
|
85
|
-
<% end %>
|
86
|
-
<% end %>
|
87
|
-
</ul>
|
88
|
-
<% end %>
|
89
|
-
|
90
|
-
<% processed_pages = pages.select{|p| !p.exception} %>
|
91
|
-
<% if processed_pages.size > 0 %>
|
92
|
-
<h2>DETAILS PER PAGE</h2>
|
93
|
-
<% processed_pages.each do |page| %>
|
94
|
-
<div class='page'>
|
95
|
-
<h3><a href='<%= page.url %>'><%= page.url %></a></h3>
|
96
|
-
<p class='page_summary'>
|
97
|
-
<%= "#{page.errors.length} errors, #{page.warnings.length} warnings" %>
|
98
|
-
</p>
|
99
|
-
|
100
|
-
<ul class="page_errors">
|
101
|
-
<% page.errors.sort_by {|e| e.line.to_i}.each do |error| %>
|
71
|
+
<div class="container">
|
72
|
+
<div class="content">
|
73
|
+
<h1>MARKUP VALIDATION FOR <a href='<%= @url %>'><%= @url %></a></h1>
|
74
|
+
|
75
|
+
<h2>SITEMAP SUMMARY</h2>
|
76
|
+
<p>TOTAL: <%= errors.length %> errors, <%= warnings.length %> warnings.</p>
|
77
|
+
|
78
|
+
<% if errors.length > 0 %>
|
79
|
+
<h2>POPULAR ERRORS</h2>
|
80
|
+
<ul>
|
81
|
+
<% errors.group_by {|e| e.message_id}.sort_by {|m,e| e.length}.reverse.each do |message_id, errors| %>
|
82
|
+
<% if message_id == 'html5' %>
|
83
|
+
<li><%= errors.length %> HTML5 errors found</li>
|
102
84
|
<li>
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
85
|
+
<ul>
|
86
|
+
<% errors.select{|e| e.message_id == 'html5'}
|
87
|
+
.group_by {|e| e.text}
|
88
|
+
.sort_by {|m,e| e.length}
|
89
|
+
.reverse.each do |text, errors| %>
|
90
|
+
<li><%= errors.length %> times: <strong><%= CGI::escapeHTML(text) %></strong></li>
|
108
91
|
<% end %>
|
109
|
-
|
110
|
-
<%= error.text %>
|
92
|
+
</ul>
|
111
93
|
</li>
|
94
|
+
<% elsif message_id %>
|
95
|
+
<li>error <a href="http://validator.w3.org/docs/errors.html#ve-<%= message_id %>"><%= message_id %></a>
|
96
|
+
happens <%= errors.length %> times</li>
|
112
97
|
<% end %>
|
113
|
-
|
98
|
+
<% end %>
|
99
|
+
</ul>
|
100
|
+
<% end %>
|
114
101
|
|
115
|
-
|
116
|
-
|
102
|
+
<% if warnings.length > 0 %>
|
103
|
+
<h2>POPULAR WARNINGS</h2>
|
104
|
+
<ul>
|
105
|
+
<% warnings.group_by {|w| w.message_id}.sort_by {|m,w| w.length}.reverse.each do |message_id, warnings| %>
|
106
|
+
<% if message_id == 'html5' %>
|
107
|
+
<li><%= warnings.length %> HTML5 warnings found</li>
|
117
108
|
<li>
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
109
|
+
<ul>
|
110
|
+
<% warnings.select{|w| w.message_id == 'html5'}
|
111
|
+
.group_by {|w| w.text}
|
112
|
+
.sort_by {|m,w| w.length}
|
113
|
+
.reverse.each do |text, warnings| %>
|
114
|
+
<li><%= warnings.length %> times: <strong><%= CGI::escapeHTML(text) %></strong></li>
|
123
115
|
<% end %>
|
124
|
-
|
125
|
-
<%= warning.text %>
|
116
|
+
</ul>
|
126
117
|
</li>
|
118
|
+
<% elsif message_id %>
|
119
|
+
<li>warning <a href="http://validator.w3.org/docs/errors.html#ve-<%= message_id %>"><%= message_id %></a>
|
120
|
+
found <%= warnings.length %> times</li>
|
127
121
|
<% end %>
|
128
|
-
|
129
|
-
</
|
122
|
+
<% end %>
|
123
|
+
</ul>
|
124
|
+
<% end %>
|
125
|
+
|
126
|
+
<% processed_pages = pages.select{|p| !p.exception} %>
|
127
|
+
<% if processed_pages.size > 0 %>
|
128
|
+
<h2>DETAILS PER PAGE</h2>
|
129
|
+
<% processed_pages.each do |page| %>
|
130
|
+
<div class='page'>
|
131
|
+
<h3><a href='<%= page.url %>'><%= page.url %></a></h3>
|
132
|
+
<p class='page_summary'>
|
133
|
+
<%= "#{page.errors.length} errors, #{page.warnings.length} warnings" %>
|
134
|
+
</p>
|
135
|
+
|
136
|
+
<ul class="page_errors">
|
137
|
+
<% page.errors.sort_by {|e| e.line.to_i}.each do |error| %>
|
138
|
+
<li>
|
139
|
+
<% if error.message_id == 'html5' %>
|
140
|
+
HTML5 error on line <%= error.line %>:
|
141
|
+
<% else %>
|
142
|
+
Error <a href="http://validator.w3.org/docs/errors.html#ve-<%= error.message_id %>"><%= error.message_id %></a>
|
143
|
+
on line <%= error.line %>:
|
144
|
+
<% end %>
|
145
|
+
|
146
|
+
<%= CGI::escapeHTML(error.text) %>
|
147
|
+
</li>
|
148
|
+
<% end %>
|
149
|
+
</ul>
|
150
|
+
|
151
|
+
<ul class="page_warnings">
|
152
|
+
<% page.warnings.sort_by {|w| w.line.to_i}.each do |warning| %>
|
153
|
+
<li>
|
154
|
+
<% if warning.message_id == 'html5' %>
|
155
|
+
HTML5 warning on line <%= warning.line %>:
|
156
|
+
<% else %>
|
157
|
+
Warning <a href="http://validator.w3.org/docs/errors.html#ve-<%= warning.message_id %>"><%= warning.message_id %></a>
|
158
|
+
on line <%= warning.line %>:
|
159
|
+
<% end %>
|
160
|
+
|
161
|
+
<%= CGI::escapeHTML(warning.text) %>
|
162
|
+
</li>
|
163
|
+
<% end %>
|
164
|
+
</ul>
|
165
|
+
</div>
|
166
|
+
<% end %>
|
130
167
|
<% end %>
|
131
|
-
<% end %>
|
132
|
-
</div>
|
133
168
|
|
134
|
-
|
135
|
-
|
136
|
-
|
169
|
+
<footer>
|
170
|
+
<p>This markup validation report has been generated using the <a href="https://github.com/jaimeiniesta/w3clove">W3Clove</a> gem.</p>
|
171
|
+
<p>You can also find an online version that lets you store the results and re-check the URLs later, at <a href="http://w3clove.com">w3clove.com</a>.</p>
|
172
|
+
<p><strong>W3Clove</strong> is a lovely site-wide markup validator. We're not associated with the W3C but we love it!</p>
|
173
|
+
</footer>
|
174
|
+
</div>
|
137
175
|
</div>
|
138
176
|
</body>
|
139
177
|
</html>
|
data/lib/w3clove/version.rb
CHANGED
data/w3clove.gemspec
CHANGED
@@ -16,11 +16,11 @@ and outputs a detailed report with all errors and warnings}
|
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
gem.version = W3Clove::VERSION
|
18
18
|
|
19
|
-
gem.add_dependency 'w3c_validators', '1.0.2'
|
20
|
-
gem.add_dependency 'nokogiri', '1.5.0'
|
21
|
-
gem.add_dependency 'metainspector', '1.8.7'
|
19
|
+
gem.add_dependency 'w3c_validators', '~> 1.0.2'
|
20
|
+
gem.add_dependency 'nokogiri', '~> 1.5.0'
|
21
|
+
gem.add_dependency 'metainspector', '~> 1.8.7'
|
22
22
|
|
23
|
-
gem.add_development_dependency 'rspec', '2.5.0'
|
24
|
-
gem.add_development_dependency 'mocha', '0.9.12'
|
25
|
-
gem.add_development_dependency 'rake', '0.9.2'
|
23
|
+
gem.add_development_dependency 'rspec', '~> 2.5.0'
|
24
|
+
gem.add_development_dependency 'mocha', '~> 0.9.12'
|
25
|
+
gem.add_development_dependency 'rake', '~> 0.9.2'
|
26
26
|
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: w3clove
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 0.5.1
|
8
|
+
- 6
|
9
|
+
version: "0.6"
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Jaime Iniesta
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2011-12-
|
17
|
+
date: 2011-12-15 00:00:00 Z
|
19
18
|
dependencies:
|
20
19
|
- !ruby/object:Gem::Dependency
|
21
20
|
name: w3c_validators
|
@@ -23,7 +22,7 @@ dependencies:
|
|
23
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
23
|
none: false
|
25
24
|
requirements:
|
26
|
-
- -
|
25
|
+
- - ~>
|
27
26
|
- !ruby/object:Gem::Version
|
28
27
|
hash: 19
|
29
28
|
segments:
|
@@ -39,7 +38,7 @@ dependencies:
|
|
39
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
40
|
requirements:
|
42
|
-
- -
|
41
|
+
- - ~>
|
43
42
|
- !ruby/object:Gem::Version
|
44
43
|
hash: 3
|
45
44
|
segments:
|
@@ -55,7 +54,7 @@ dependencies:
|
|
55
54
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
55
|
none: false
|
57
56
|
requirements:
|
58
|
-
- -
|
57
|
+
- - ~>
|
59
58
|
- !ruby/object:Gem::Version
|
60
59
|
hash: 57
|
61
60
|
segments:
|
@@ -71,7 +70,7 @@ dependencies:
|
|
71
70
|
requirement: &id004 !ruby/object:Gem::Requirement
|
72
71
|
none: false
|
73
72
|
requirements:
|
74
|
-
- -
|
73
|
+
- - ~>
|
75
74
|
- !ruby/object:Gem::Version
|
76
75
|
hash: 27
|
77
76
|
segments:
|
@@ -87,7 +86,7 @@ dependencies:
|
|
87
86
|
requirement: &id005 !ruby/object:Gem::Requirement
|
88
87
|
none: false
|
89
88
|
requirements:
|
90
|
-
- -
|
89
|
+
- - ~>
|
91
90
|
- !ruby/object:Gem::Version
|
92
91
|
hash: 35
|
93
92
|
segments:
|
@@ -103,7 +102,7 @@ dependencies:
|
|
103
102
|
requirement: &id006 !ruby/object:Gem::Requirement
|
104
103
|
none: false
|
105
104
|
requirements:
|
106
|
-
- -
|
105
|
+
- - ~>
|
107
106
|
- !ruby/object:Gem::Version
|
108
107
|
hash: 63
|
109
108
|
segments:
|