aboutsummaryrefslogtreecommitdiffstats
path: root/guides/w3c_validator.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:55:02 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 20:16:27 +0200
commit80e66cc4d90bf8c15d1a5f6e3152e90147f00772 (patch)
treee7e75464af04f3cf1935b29238dbd7cb2337b0dd /guides/w3c_validator.rb
parent411ccbdab2608c62aabdb320d52cb02d446bb39c (diff)
downloadrails-80e66cc4d90bf8c15d1a5f6e3152e90147f00772.tar.gz
rails-80e66cc4d90bf8c15d1a5f6e3152e90147f00772.tar.bz2
rails-80e66cc4d90bf8c15d1a5f6e3152e90147f00772.zip
normalizes indentation and whitespace across the project
Diffstat (limited to 'guides/w3c_validator.rb')
-rw-r--r--guides/w3c_validator.rb52
1 files changed, 26 insertions, 26 deletions
diff --git a/guides/w3c_validator.rb b/guides/w3c_validator.rb
index 6eddd08906..aad9ac2608 100644
--- a/guides/w3c_validator.rb
+++ b/guides/w3c_validator.rb
@@ -57,39 +57,39 @@ module RailsGuides
end
private
- def guides_to_validate
- guides = Dir["./output/*.html"]
- guides.delete("./output/layout.html")
- guides.delete("./output/_license.html")
- guides.delete("./output/_welcome.html")
- ENV.key?("ONLY") ? select_only(guides) : guides
- end
+ def guides_to_validate
+ guides = Dir["./output/*.html"]
+ guides.delete("./output/layout.html")
+ guides.delete("./output/_license.html")
+ guides.delete("./output/_welcome.html")
+ ENV.key?("ONLY") ? select_only(guides) : guides
+ end
- def select_only(guides)
- prefixes = ENV["ONLY"].split(",").map(&:strip)
- guides.select do |guide|
- prefixes.any? {|p| guide.start_with?("./output/#{p}")}
+ def select_only(guides)
+ prefixes = ENV["ONLY"].split(",").map(&:strip)
+ guides.select do |guide|
+ prefixes.any? {|p| guide.start_with?("./output/#{p}")}
+ end
end
- end
- def show_results(error_list)
- if error_list.size == 0
- puts "\n\nAll checked guides validate OK!"
- else
- error_summary = error_detail = ""
+ 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"
- errors.each do |error|
- error_detail += "\n "+error.to_s.delete("\n")
+ error_list.each_pair do |name, errors|
+ error_summary += "\n #{name}"
+ error_detail += "\n\n #{name} has #{errors.size} validation error(s):\n"
+ errors.each do |error|
+ error_detail += "\n "+error.to_s.delete("\n")
+ end
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
+ 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
end