w3clove 0.0.2 → 0.2.1
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/lib/w3clove/validator.rb +12 -8
- data/lib/w3clove/version.rb +1 -1
- metadata +2 -2
data/lib/w3clove/validator.rb
CHANGED
@@ -12,7 +12,7 @@ module W3Clove
|
|
12
12
|
|
13
13
|
##
|
14
14
|
# Parses a remote xml sitemap and checks markup validation for each url
|
15
|
-
# Shows progress on dot-style (...F...FFE..). A dot is a page
|
15
|
+
# Shows progress on dot-style (...F...FFE..). A dot is a valid page,
|
16
16
|
# an F is a page with errors, and an E is an exception
|
17
17
|
# After the checking is done, a detailed summary is shown
|
18
18
|
def check(url)
|
@@ -33,7 +33,7 @@ module W3Clove
|
|
33
33
|
def show_results(sitemap)
|
34
34
|
show_sitemap_summary(sitemap)
|
35
35
|
show_popular_errors(sitemap)
|
36
|
-
|
36
|
+
show_popular_warnings(sitemap)
|
37
37
|
say "\n\nDETAILS PER PAGE"
|
38
38
|
sitemap.pages.select {|page| !page.errors.empty?}.each do |p|
|
39
39
|
show_page_summary(p)
|
@@ -49,16 +49,20 @@ HEREDOC
|
|
49
49
|
|
50
50
|
def show_popular_errors(sitemap)
|
51
51
|
say "\n\nMOST POPULAR ERRORS\n"
|
52
|
-
sitemap.errors.group_by {|e| e.message_id}
|
53
|
-
|
54
|
-
|
52
|
+
sitemap.errors.group_by {|e| e.message_id}
|
53
|
+
.sort_by {|m,e| e.length}
|
54
|
+
.reverse.each do |message_id, errors|
|
55
|
+
say "error #{message_id} happens #{errors.length} times"
|
56
|
+
end
|
55
57
|
end
|
56
58
|
|
57
59
|
def show_popular_warnings(sitemap)
|
58
60
|
say "\n\nMOST POPULAR WARNINGS\n"
|
59
|
-
sitemap.warnings.group_by {|e| e.message_id}
|
60
|
-
|
61
|
-
|
61
|
+
sitemap.warnings.group_by {|e| e.message_id}
|
62
|
+
.sort_by {|m,e| e.length}
|
63
|
+
.reverse.each do |message_id, warnings|
|
64
|
+
say "warning #{message_id} happens #{warnings.length} times"
|
65
|
+
end
|
62
66
|
end
|
63
67
|
|
64
68
|
def show_page_summary(page)
|
data/lib/w3clove/version.rb
CHANGED