From b451de0d6de4df6bc66b274cec73b919f823d5ae Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 14 Aug 2010 02:13:00 -0300 Subject: Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) --- railties/guides/w3c_validator.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'railties/guides/w3c_validator.rb') diff --git a/railties/guides/w3c_validator.rb b/railties/guides/w3c_validator.rb index 4da48bf3fb..da5200c0b7 100644 --- a/railties/guides/w3c_validator.rb +++ b/railties/guides/w3c_validator.rb @@ -21,7 +21,7 @@ # # Separate many using commas: # -# # validates only +# # validates only # ONLY=assoc,migrations rake validate_guides # # --------------------------------------------------------------------------- @@ -32,13 +32,13 @@ include W3CValidators module RailsGuides class Validator - + def validate validator = MarkupValidator.new STDOUT.sync = true errors_on_guides = {} - guides_to_validate.each do |f| + guides_to_validate.each do |f| results = validator.validate_file(f) if results.validity @@ -48,10 +48,10 @@ module RailsGuides errors_on_guides[f] = results.errors end end - + show_results(errors_on_guides) end - + private def guides_to_validate guides = Dir["./guides/output/*.html"] @@ -65,13 +65,13 @@ module RailsGuides prefixes.any? {|p| guide.start_with?("./guides/output/#{p}")} end end - + def show_results(error_list) if error_list.size == 0 puts "\n\nAll checked guides validate OK!" else error_summary = error_detail = "" - + error_list.each_pair do |name, errors| error_summary += "\n #{name}" error_detail += "\n\n #{name} has #{errors.size} validation error(s):\n" @@ -79,12 +79,12 @@ module RailsGuides error_detail += "\n "+error.to_s.gsub("\n", "") end end - + puts "\n\nThere are #{error_list.size} guides with validation errors:\n" + error_summary puts "\nHere are the detailed errors for each guide:" + error_detail end end - + end end -- cgit v1.2.3