w3clove 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/w3clove/sitemap.rb +10 -1
- data/lib/w3clove/version.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -14,7 +14,7 @@ w3clove is a Ruby gem that can be installed on the usual way
|
|
14
14
|
|
15
15
|
Pass it the url of an XML sitemap to be checked, and the filename where you want your report to be generated, like:
|
16
16
|
|
17
|
-
w3clove
|
17
|
+
w3clove http://ryanair.com/sitemap.xml report.html
|
18
18
|
|
19
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.
|
20
20
|
|
data/lib/w3clove/sitemap.rb
CHANGED
@@ -14,18 +14,27 @@ module W3Clove
|
|
14
14
|
@url = url
|
15
15
|
end
|
16
16
|
|
17
|
+
##
|
18
|
+
# Returns the first 100 unique URLs from the sitemap
|
17
19
|
def pages
|
18
|
-
@pages ||= pages_in_sitemap.uniq {|p| p.url}
|
20
|
+
@pages ||= pages_in_sitemap.uniq {|p| p.url}[0..99]
|
19
21
|
end
|
20
22
|
|
23
|
+
##
|
24
|
+
# Returns the combined validation errors of all the pages
|
21
25
|
def errors
|
22
26
|
@errors ||= pages.map {|p| p.errors}.flatten.reject {|e| e.nil?}
|
23
27
|
end
|
24
28
|
|
29
|
+
##
|
30
|
+
# Returns the combined validation warnings of all the pages
|
25
31
|
def warnings
|
26
32
|
@warnings ||= pages.map {|p| p.warnings}.flatten.reject {|e| e.nil?}
|
27
33
|
end
|
28
34
|
|
35
|
+
##
|
36
|
+
# Returns the binding, needed to paint the ERB template when generating
|
37
|
+
# the HTML report (see w3clove/reporter.rb)
|
29
38
|
def get_binding
|
30
39
|
binding
|
31
40
|
end
|
data/lib/w3clove/version.rb
CHANGED