w3clove 0.3.5 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  *.gem
2
2
  .bundle
3
+ .rvmrc
3
4
  Gemfile.lock
4
5
  pkg/*
data/.rvmrc.example ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.2-p0@w3clovegem
data/README.rdoc CHANGED
@@ -1,7 +1,5 @@
1
1
  = w3clove
2
2
 
3
- This is my {Ruby Mendicant University}[http://university.rubymendicant.com/] personal project, and is currently in alpha status.
4
-
5
3
  It's a site-wide markup validator, a Ruby gem that lets you validate a whole web site against the W3C Markup Validator, from the command line, and generate a comprehensive report of all errors found.
6
4
 
7
5
  = Installation:
@@ -12,15 +10,17 @@ w3clove is a Ruby gem that can be installed on the usual way
12
10
 
13
11
  = Usage:
14
12
 
15
- Pass it the url of an XML sitemap to be checked, and the filename where you want your report to be generated, like:
13
+ Pass it a starting URL to be checked, and the filename where you want your report to be generated, like:
16
14
 
17
15
  w3clove http://ryanair.com/sitemap.xml report.html
18
16
 
19
- This will validate all the URLs of your sitemap.xml (so be sure to pass it a short one or you'll wait for ages), and generate an HTML file with the full report.
17
+ This will validate all the internal URLs found on the starting URL, up to a maximum of 100 URLs, and generate an HTML file with the full report.
18
+
19
+ You can pass w3clove an XML sitemap or the URL of a website; it will scrape it in search of URLs to validate.
20
20
 
21
21
  = Notes:
22
22
 
23
- This gem requires Ruby 1.9, and has been tested on Ruby 1.9.2
23
+ This gem requires Ruby 1.9, and has been tested on Ruby 1.9.2-p0
24
24
 
25
25
  = License:
26
26
 
data/bin/w3clove CHANGED
@@ -7,7 +7,7 @@ begin
7
7
  if ARGV.length == 2
8
8
  W3Clove::Validator.check(ARGV[0], ARGV[1])
9
9
  else
10
- puts "USAGE: w3clove url_of_xml_sitemap output_file.html"
10
+ puts "USAGE: w3clove url_of_sitemap output_file.html"
11
11
  end
12
12
  rescue
13
13
  puts "There was an error processing your request"
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'open-uri'
4
4
  require 'nokogiri'
5
+ require 'metainspector'
5
6
 
6
7
  module W3Clove
7
8
  ##
@@ -41,11 +42,22 @@ module W3Clove
41
42
 
42
43
  private
43
44
 
45
+ # Scrapes the url in search of links.
46
+ # It first assumes it's an XML sitemap; if no locations found, it will try to
47
+ # scrape the links from HTML.
48
+ # For HTML sources, it will only get the links that start with the sitemap url, convert relative links
49
+ # to absolute links, and remove anchors from links
44
50
  def pages_in_sitemap
45
- locations.map {|loc| W3Clove::Page.new(loc.text)}
51
+ pages = xml_locations.map {|loc| W3Clove::Page.new(loc.text)}
52
+ if pages.empty?
53
+ m = MetaInspector.new(url)
54
+ links = m.absolute_links.select {|l| l.start_with?(m.url)}.map {|l| l.split('#')[0]}.uniq
55
+ pages = links.map {|link| W3Clove::Page.new(link)}
56
+ end
57
+ pages
46
58
  end
47
59
 
48
- def locations
60
+ def xml_locations
49
61
  Nokogiri::XML(doc).css('loc')
50
62
  end
51
63
 
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module W3Clove
4
- VERSION = "0.3.5"
4
+ VERSION = "0.4.0"
5
5
  end
@@ -0,0 +1,10 @@
1
+ <html>
2
+ <head>
3
+ <title>Sample file with absolute links</title>
4
+ </head>
5
+ <body>
6
+ <a href="http://example.com">index</a>
7
+ <a href="http://example.com/faqs">FAQs</a>
8
+ <a href="http://example.com/contact">contact</a>
9
+ </body>
10
+ </html>
@@ -0,0 +1,290 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
+
8
+ <title>Ruby on Rails Guides
9
+ </title>
10
+
11
+ <link rel="stylesheet" type="text/css" href="stylesheets/style.css" />
12
+ <link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
13
+
14
+ <link rel="stylesheet" type="text/css" href="stylesheets/syntaxhighlighter/shCore.css" />
15
+ <link rel="stylesheet" type="text/css" href="stylesheets/syntaxhighlighter/shThemeRailsGuides.css" />
16
+ </head>
17
+ <body class="guide">
18
+ <div id="topNav">
19
+ <div class="wrapper">
20
+ <strong>More at <a href="http://rubyonrails.org/">rubyonrails.org:</a> </strong>
21
+ <a href="http://rubyonrails.org/">Overview</a> |
22
+ <a href="http://rubyonrails.org/download">Download</a> |
23
+ <a href="http://rubyonrails.org/deploy">Deploy</a> |
24
+ <a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/overview">Code</a> |
25
+ <a href="http://rubyonrails.org/screencasts">Screencasts</a> |
26
+ <a href="http://rubyonrails.org/documentation">Documentation</a> |
27
+ <a href="http://rubyonrails.org/ecosystem">Ecosystem</a> |
28
+ <a href="http://rubyonrails.org/community">Community</a> |
29
+ <a href="http://weblog.rubyonrails.org/">Blog</a>
30
+ </div>
31
+ </div>
32
+ <div id="header">
33
+ <div class="wrapper clearfix">
34
+ <h1><a href="index.html" title="Return to home page">Guides.rubyonrails.org</a></h1>
35
+ <p class="hide"><a href="#mainCol">Skip navigation</a>.</p>
36
+ <ul class="nav">
37
+ <li><a href="index.html">Home</a></li>
38
+ <li class="index"><a href="index.html" onclick="guideMenu(); return false;" id="guidesMenu">Guides Index</a>
39
+ <div id="guides" class="clearfix" style="display: none;">
40
+ <hr />
41
+ <dl class="L">
42
+ <dt>Start Here</dt>
43
+ <dd><a href="getting_started.html">Getting Started with Rails</a></dd>
44
+ <dt>Models</dt>
45
+ <dd><a href="migrations.html">Rails Database Migrations</a></dd>
46
+ <dd><a href="active_record_validations_callbacks.html">Active Record Validations and Callbacks</a></dd>
47
+ <dd><a href="association_basics.html">Active Record Associations</a></dd>
48
+ <dd><a href="active_record_querying.html">Active Record Query Interface</a></dd>
49
+ <dt>Views</dt>
50
+ <dd><a href="layouts_and_rendering.html">Layouts and Rendering in Rails</a></dd>
51
+ <dd><a href="form_helpers.html">Action View Form Helpers</a></dd>
52
+ <dt>Controllers</dt>
53
+ <dd><a href="action_controller_overview.html">Action Controller Overview</a></dd>
54
+ <dd><a href="routing.html">Rails Routing from the Outside In</a></dd>
55
+ </dl>
56
+ <dl class="R">
57
+ <dt>Digging Deeper</dt>
58
+ <dd><a href="active_support_core_extensions.html">Active Support Core Extensions</a></dd>
59
+ <dd><a href="i18n.html">Rails Internationalization API</a></dd>
60
+ <dd><a href="action_mailer_basics.html">Action Mailer Basics</a></dd>
61
+ <dd><a href="testing.html">Testing Rails Applications</a></dd>
62
+ <dd><a href="security.html">Securing Rails Applications</a></dd>
63
+ <dd><a href="debugging_rails_applications.html">Debugging Rails Applications</a></dd>
64
+ <dd><a href="performance_testing.html">Performance Testing Rails Applications</a></dd>
65
+ <dd><a href="configuring.html">Configuring Rails Applications</a></dd>
66
+ <dd><a href="command_line.html">Rails Command Line Tools and Rake Tasks</a></dd>
67
+ <dd><a href="caching_with_rails.html">Caching with Rails</a></dd>
68
+
69
+ <dt>Extending Rails</dt>
70
+ <dd><a href="plugins.html">The Basics of Creating Rails Plugins</a></dd>
71
+ <dd><a href="rails_on_rack.html">Rails on Rack</a></dd>
72
+ <dd><a href="generators.html">Creating and Customizing Rails Generators</a></dd>
73
+
74
+ <dt>Contributing to Ruby on Rails</dt>
75
+ <dd><a href="contributing_to_ruby_on_rails.html">Contributing to Ruby on Rails</a></dd>
76
+ <dd><a href="api_documentation_guidelines.html">API Documentation Guidelines</a></dd>
77
+ <dd><a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a></dd>
78
+
79
+ <dt>Release Notes</dt>
80
+ <dd><a href="3_0_release_notes.html">Ruby on Rails 3.0 Release Notes</a></dd>
81
+ <dd><a href="2_3_release_notes.html">Ruby on Rails 2.3 Release Notes</a></dd>
82
+ <dd><a href="2_2_release_notes.html">Ruby on Rails 2.2 Release Notes</a></dd>
83
+ </dl>
84
+ </div>
85
+ </li>
86
+ <li><a href="contribute.html">Contribute</a></li>
87
+ <li><a href="credits.html">Credits</a></li>
88
+ </ul>
89
+ </div>
90
+ </div>
91
+ <hr class="hide" />
92
+
93
+ <div id="feature">
94
+ <div class="wrapper">
95
+ <h2>Ruby on Rails Guides (v3.0.8)</h2>
96
+
97
+ <p>
98
+ These are the new guides for Rails 3. The guides for Rails 2.3 are still available
99
+ at <a href="http://guides.rubyonrails.org/v2.3.8/">http://guides.rubyonrails.org/v2.3.8/</a>.
100
+ </p>
101
+ <p>
102
+ These guides are designed to make you immediately productive with Rails,
103
+ and to help you understand how all of the pieces fit together.
104
+ </p>
105
+
106
+
107
+
108
+ <div id="subCol">
109
+ <dl>
110
+ <dd class="warning">Rails Guides are a result of the ongoing <a href="http://hackfest.rubyonrails.org">Guides hackfest</a>, and a work in progress.</dd>
111
+ <dd class="work-in-progress">Guides marked with this icon are currently being worked on. While they might still be useful to you, they may contain incomplete information and even errors. You can help by reviewing them and posting your comments and corrections to the author.</dd>
112
+ </dl>
113
+ </div>
114
+
115
+ </div>
116
+ </div>
117
+
118
+ <div id="container">
119
+ <div class="wrapper">
120
+ <div id="mainCol">
121
+
122
+
123
+
124
+ <h3>Start Here</h3>
125
+
126
+ <dl>
127
+ <dt><a href="getting_started.html">Getting Started with Rails</a></dt><dd>
128
+ <p>Everything you need to know to install Rails and create your first application.</p>
129
+ </dd></dl>
130
+
131
+ <h3>Models</h3>
132
+
133
+ <dl>
134
+ <dt><a href="migrations.html">Rails Database Migrations</a></dt><dd>
135
+ <p>This guide covers how you can use Active Record migrations to alter your database in a structured and organized manner.</p>
136
+ </dd>
137
+ <dt><a href="active_record_validations_callbacks.html">Active Record Validations and Callbacks</a></dt><dd>
138
+ <p>This guide covers how you can use Active Record validations and callbacks.</p>
139
+ </dd>
140
+ <dt><a href="association_basics.html">Active Record Associations</a></dt><dd>
141
+ <p>This guide covers all the associations provided by Active Record.</p>
142
+ </dd>
143
+ <dt><a href="active_record_querying.html">Active Record Query Interface</a></dt><dd>
144
+ <p>This guide covers the database query interface provided by Active Record.</p>
145
+ </dd></dl>
146
+
147
+ <h3>Views</h3>
148
+
149
+ <dl>
150
+ <dt><a href="layouts_and_rendering.html">Layouts and Rendering in Rails</a></dt><dd>
151
+ <p>This guide covers the basic layout features of Action Controller and Action View, including rendering and redirecting, using content_for blocks, and working with partials.</p>
152
+ </dd>
153
+ <dt><a href="form_helpers.html">Action View Form Helpers</a></dt><dd class="work-in-progress">Work in progress</dd><dd>
154
+ <p>Guide to using built-in Form helpers.</p>
155
+ </dd></dl>
156
+
157
+ <h3>Controllers</h3>
158
+
159
+ <dl>
160
+ <dt><a href="action_controller_overview.html">Action Controller Overview</a></dt><dd>
161
+ <p>This guide covers how controllers work and how they fit into the request cycle in your application. It includes sessions, filters, and cookies, data streaming, and dealing with exceptions raised by a request, among other topics.</p>
162
+ </dd>
163
+ <dt><a href="routing.html">Rails Routing from the Outside In</a></dt><dd>
164
+ <p>This guide covers the user-facing features of Rails routing. If you want to understand how to use routing in your own Rails applications, start here.</p>
165
+ </dd></dl>
166
+
167
+ <h3>Digging Deeper</h3>
168
+
169
+ <dl>
170
+
171
+ <dt><a href="active_support_core_extensions.html">Active Support Core Extensions</a></dt><dd>
172
+ <p>This guide documents the Ruby core extensions defined in Active Support.</p>
173
+ </dd>
174
+ <dt><a href="i18n.html">Rails Internationalization API</a></dt><dd>
175
+ <p>This guide covers how to add internationalization to your applications. Your application will be able to translate content to different languages, change pluralization rules, use correct date formats for each country and so on.</p>
176
+ </dd>
177
+ <dt><a href="action_mailer_basics.html">Action Mailer Basics</a></dt><dd class="work-in-progress">Work in progress</dd><dd>
178
+ <p>This guide describes how to use Action Mailer to send and receive emails.</p>
179
+ </dd>
180
+ <dt><a href="testing.html">Testing Rails Applications</a></dt><dd class="work-in-progress">Work in progress</dd><dd>
181
+ <p>This is a rather comprehensive guide to doing both unit and functional tests in Rails. It covers everything from &quot;What is a test?&quot; to the testing APIs. Enjoy.</p>
182
+ </dd>
183
+ <dt><a href="security.html">Securing Rails Applications</a></dt><dd>
184
+ <p>This guide describes common security problems in web applications and how to avoid them with Rails.</p>
185
+ </dd>
186
+ <dt><a href="debugging_rails_applications.html">Debugging Rails Applications</a></dt><dd>
187
+ <p>This guide describes how to debug Rails applications. It covers the different ways of achieving this and how to understand what is happening "behind the scenes" of your code.</p>
188
+ </dd>
189
+ <dt><a href="performance_testing.html">Performance Testing Rails Applications</a></dt><dd>
190
+ <p>This guide covers the various ways of performance testing a Ruby on Rails application.</p>
191
+ </dd>
192
+ <dt><a href="configuring.html">Configuring Rails Applications</a></dt><dd>
193
+ <p>This guide covers the basic configuration settings for a Rails application.</p>
194
+ </dd>
195
+ <dt><a href="command_line.html">Rails Command Line Tools and Rake tasks</a></dt><dd class="work-in-progress">Work in progress</dd><dd>
196
+ <p>This guide covers the command line tools and rake tasks provided by Rails.</p>
197
+ </dd>
198
+ <dt><a href="caching_with_rails.html">Caching with Rails</a></dt><dd class="work-in-progress">Work in progress</dd><dd>
199
+ <p>Various caching techniques provided by Rails.</p>
200
+ </dd></dl>
201
+
202
+ <h3>Extending Rails</h3>
203
+
204
+ <dl>
205
+ <dt><a href="plugins.html">The Basics of Creating Rails Plugins</a></dt><dd class="work-in-progress">Work in progress</dd><dd>
206
+ <p>This guide covers how to build a plugin to extend the functionality of Rails.</p>
207
+ </dd>
208
+ <dt><a href="rails_on_rack.html">Rails on Rack</a></dt><dd>
209
+ <p>This guide covers Rails integration with Rack and interfacing with other Rack components.</p>
210
+ </dd>
211
+ <dt><a href="generators.html">Creating and Customizing Rails Generators</a></dt><dd>
212
+ <p>This guide covers the process of adding a brand new generator to your extension
213
+ or providing an alternative to an element of a built-in Rails generator (such as
214
+ providing alternative test stubs for the scaffold generator).</p>
215
+ </dd></dl>
216
+
217
+ <h3>Contributing to Ruby on Rails</h3>
218
+
219
+ <dl>
220
+ <dt><a href="contributing_to_ruby_on_rails.html">Contributing to Ruby on Rails</a></dt><dd>
221
+ <p>Rails is not &quot;somebody else's framework.&quot; This guide covers a variety of ways that you can get involved in the ongoing development of Rails.</p>
222
+ </dd>
223
+ <dt><a href="api_documentation_guidelines.html">API Documentation Guidelines</a></dt><dd>
224
+ <p>This guide documents the Ruby on Rails API documentation guidelines.</p>
225
+ </dd>
226
+ <dt><a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a></dt><dd>
227
+ <p>This guide documents the Ruby on Rails guides guidelines.</p>
228
+ </dd></dl>
229
+
230
+ <h3>Release Notes</h3>
231
+
232
+ <dl>
233
+ <dt><a href="3_0_release_notes.html">Ruby on Rails 3.0 Release Notes</a></dt><dd>
234
+ <p>Release notes for Rails 3.0.</p>
235
+ </dd>
236
+ <dt><a href="2_3_release_notes.html">Ruby on Rails 2.3 Release Notes</a></dt><dd>
237
+ <p>Release notes for Rails 2.3.</p>
238
+ </dd>
239
+ <dt><a href="2_2_release_notes.html">Ruby on Rails 2.2 Release Notes</a></dt><dd>
240
+ <p>Release notes for Rails 2.2.</p>
241
+ </dd></dl>
242
+
243
+
244
+ <h3>Feedback</h3>
245
+ <p>
246
+ You're encouraged to help in keeping the quality of this guide.
247
+ </p>
248
+ <p>
249
+ If you see any typos or factual errors you are confident to
250
+ patch please clone <a href="https://github.com/lifo/docrails">docrails</a>
251
+ and push the change yourself. That branch of Rails has public write access.
252
+ Commits are still reviewed, but that happens after you've submitted your
253
+ contribution. <a href="https://github.com/lifo/docrails">docrails</a> is
254
+ cross-merged with master periodically.
255
+ </p>
256
+ <p>
257
+ You may also find incomplete content, or stuff that is not up to date.
258
+ Please do add any missing documentation for master. Check the
259
+ <a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a>
260
+ guide for style and conventions.
261
+ </p>
262
+ <p>
263
+ Issues may also be reported <a href="https://github.com/lifo/docrails/issues">in Github</a>.
264
+ </p>
265
+ <p>And last but not least, any kind of discussion regarding Ruby on Rails
266
+ documentation is very welcome in the <a href="http://groups.google.com/group/rubyonrails-docs">rubyonrails-docs mailing list</a>.
267
+ </p>
268
+ </div>
269
+ </div>
270
+ </div>
271
+
272
+ <hr class="hide" />
273
+ <div id="footer">
274
+ <div class="wrapper">
275
+ <p>This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0</a> License</p>
276
+ <p>"Rails", "Ruby on Rails", and the Rails logo are trademarks of David Heinemeier Hansson. All rights reserved.</p>
277
+ </div>
278
+ </div>
279
+
280
+ <script type="text/javascript" src="javascripts/guides.js"></script>
281
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shCore.js"></script>
282
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushRuby.js"></script>
283
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushXml.js"></script>
284
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushSql.js"></script>
285
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushPlain.js"></script>
286
+ <script type="text/javascript">
287
+ SyntaxHighlighter.all()
288
+ </script>
289
+ </body>
290
+ </html>
data/spec/sitemap_spec.rb CHANGED
@@ -6,6 +6,10 @@ describe W3Clove::Sitemap do
6
6
  before(:each) do
7
7
  @sitemap = W3Clove::Sitemap.new('http://ryanair.com/sitemap.xml')
8
8
  @sitemap.stub!(:doc).and_return(open("#{$samples_dir}/sitemap.xml"))
9
+
10
+ @sitemap_html = W3Clove::Sitemap.new('http://guides.rubyonrails.org')
11
+ @sitemap_html.stub!(:doc).and_return(open("#{$samples_dir}/guides.rubyonrails.org.html"))
12
+
9
13
  MarkupValidator.any_instance.stubs(:validate_uri).returns(stubbed_validator_results)
10
14
  end
11
15
 
@@ -13,26 +17,35 @@ describe W3Clove::Sitemap do
13
17
  @sitemap.url.should == 'http://ryanair.com/sitemap.xml'
14
18
  end
15
19
 
16
- it "should get its pages from the xml, removing repeated urls" do
17
- @sitemap.pages.length.should == 3
18
- @sitemap.pages[0].url.should == 'http://www.ryanair.com/es/'
19
- @sitemap.pages[1].url.should == 'http://www.ryanair.com/es/careers/job'
20
- @sitemap.pages[2].url.should == 'http://www.ryanair.com/es/about'
21
- end
20
+ describe "scraping pages" do
21
+ it "should get its pages from a xml sitemap" do
22
+ @sitemap.pages.length.should == 3
23
+ @sitemap.pages[0].url.should == 'http://www.ryanair.com/es/'
24
+ @sitemap.pages[1].url.should == 'http://www.ryanair.com/es/careers/job'
25
+ @sitemap.pages[2].url.should == 'http://www.ryanair.com/es/about'
26
+ end
22
27
 
23
- it "should know the errors of all of its pages as a whole" do
24
- @sitemap.errors.length.should == 9
25
- @sitemap.errors.each do |e|
26
- e.should be_an_instance_of W3Clove::Message
27
- e.type.should == :error
28
+ it "should get pages from the sample guides.rubyonrails.org site" do
29
+ @sitemap_html.pages.length.should == 33
30
+ @sitemap_html.pages.map {|p| p.url}.should == ["http://guides.rubyonrails.org/index.html", "http://guides.rubyonrails.org/", "http://guides.rubyonrails.org/getting_started.html", "http://guides.rubyonrails.org/migrations.html", "http://guides.rubyonrails.org/active_record_validations_callbacks.html", "http://guides.rubyonrails.org/association_basics.html", "http://guides.rubyonrails.org/active_record_querying.html", "http://guides.rubyonrails.org/layouts_and_rendering.html", "http://guides.rubyonrails.org/form_helpers.html", "http://guides.rubyonrails.org/action_controller_overview.html", "http://guides.rubyonrails.org/routing.html", "http://guides.rubyonrails.org/active_support_core_extensions.html", "http://guides.rubyonrails.org/i18n.html", "http://guides.rubyonrails.org/action_mailer_basics.html", "http://guides.rubyonrails.org/testing.html", "http://guides.rubyonrails.org/security.html", "http://guides.rubyonrails.org/debugging_rails_applications.html", "http://guides.rubyonrails.org/performance_testing.html", "http://guides.rubyonrails.org/configuring.html", "http://guides.rubyonrails.org/command_line.html", "http://guides.rubyonrails.org/caching_with_rails.html", "http://guides.rubyonrails.org/plugins.html", "http://guides.rubyonrails.org/rails_on_rack.html", "http://guides.rubyonrails.org/generators.html", "http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html", "http://guides.rubyonrails.org/api_documentation_guidelines.html", "http://guides.rubyonrails.org/ruby_on_rails_guides_guidelines.html", "http://guides.rubyonrails.org/3_0_release_notes.html", "http://guides.rubyonrails.org/2_3_release_notes.html", "http://guides.rubyonrails.org/2_2_release_notes.html", "http://guides.rubyonrails.org/contribute.html", "http://guides.rubyonrails.org/credits.html", "http://guides.rubyonrails.org/v2.3.8/"]
28
31
  end
29
32
  end
30
33
 
31
- it "should know the warnings of all of its pages as a whole" do
32
- @sitemap.warnings.length.should == 9
33
- @sitemap.warnings.each do |w|
34
- w.should be_an_instance_of W3Clove::Message
35
- w.type.should == :warning
34
+ describe "validations" do
35
+ it "should know the errors of all of its pages as a whole" do
36
+ @sitemap.errors.length.should == 9
37
+ @sitemap.errors.each do |e|
38
+ e.should be_an_instance_of W3Clove::Message
39
+ e.type.should == :error
40
+ end
41
+ end
42
+
43
+ it "should know the warnings of all of its pages as a whole" do
44
+ @sitemap.warnings.length.should == 9
45
+ @sitemap.warnings.each do |w|
46
+ w.should be_an_instance_of W3Clove::Message
47
+ w.type.should == :warning
48
+ end
36
49
  end
37
50
  end
38
51
  end
data/w3clove.gemspec CHANGED
@@ -18,6 +18,7 @@ and outputs a detailed report with all errors and warnings }
18
18
 
19
19
  s.add_dependency 'w3c_validators', '1.0.2'
20
20
  s.add_dependency 'nokogiri', '1.4.4'
21
+ s.add_dependency 'metainspector', '1.6.0'
21
22
 
22
23
  s.add_development_dependency 'rspec', '2.5.0'
23
24
  s.add_development_dependency 'mocha', '0.9.12'
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 3
8
- - 5
9
- version: 0.3.5
7
+ - 4
8
+ - 0
9
+ version: 0.4.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jaime Iniesta
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-26 00:00:00 +01:00
17
+ date: 2011-06-16 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -48,9 +48,24 @@ dependencies:
48
48
  type: :runtime
49
49
  version_requirements: *id002
50
50
  - !ruby/object:Gem::Dependency
51
- name: rspec
51
+ name: metainspector
52
52
  prerelease: false
53
53
  requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - "="
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 1
60
+ - 6
61
+ - 0
62
+ version: 1.6.0
63
+ type: :runtime
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: rspec
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
54
69
  none: false
55
70
  requirements:
56
71
  - - "="
@@ -61,11 +76,11 @@ dependencies:
61
76
  - 0
62
77
  version: 2.5.0
63
78
  type: :development
64
- version_requirements: *id003
79
+ version_requirements: *id004
65
80
  - !ruby/object:Gem::Dependency
66
81
  name: mocha
67
82
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
83
+ requirement: &id005 !ruby/object:Gem::Requirement
69
84
  none: false
70
85
  requirements:
71
86
  - - "="
@@ -76,7 +91,7 @@ dependencies:
76
91
  - 12
77
92
  version: 0.9.12
78
93
  type: :development
79
- version_requirements: *id004
94
+ version_requirements: *id005
80
95
  description: " this tool allows you to check the markup validation of a whole site passing an XML sitemap,\n\
81
96
  and outputs a detailed report with all errors and warnings "
82
97
  email:
@@ -89,6 +104,7 @@ extra_rdoc_files: []
89
104
 
90
105
  files:
91
106
  - .gitignore
107
+ - .rvmrc.example
92
108
  - Gemfile
93
109
  - MIT-LICENSE
94
110
  - README.rdoc
@@ -105,6 +121,8 @@ files:
105
121
  - spec/message_spec.rb
106
122
  - spec/mocks/mocked_validator.rb
107
123
  - spec/page_spec.rb
124
+ - spec/samples/absolute_links.html
125
+ - spec/samples/guides.rubyonrails.org.html
108
126
  - spec/samples/sitemap.xml
109
127
  - spec/sitemap_spec.rb
110
128
  - spec/spec_helper.rb
@@ -145,6 +163,8 @@ test_files:
145
163
  - spec/message_spec.rb
146
164
  - spec/mocks/mocked_validator.rb
147
165
  - spec/page_spec.rb
166
+ - spec/samples/absolute_links.html
167
+ - spec/samples/guides.rubyonrails.org.html
148
168
  - spec/samples/sitemap.xml
149
169
  - spec/sitemap_spec.rb
150
170
  - spec/spec_helper.rb